Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Problem in Like Caluse

Author  Topic 

ravininave
Posting Yak Master

111 Posts

Posted - 2010-06-17 : 17:00:48
This doesn't works
Select
RegNo,FName,BankAcName,BankName,BankBranch,AcNo,IFSC,AcType ,(TotalPay -PaidAmt) as NetPay
from @DateTable Where BankName like '%@bName%' AND len(BankName) > 0 and (TotalPay -PaidAmt) > 0 and len(AcNo) > 0 Order by BankName

If I remove BankName like Clause then it works

Select
RegNo,FName,BankAcName,BankName,BankBranch,AcNo,IFSC,AcType ,(TotalPay -PaidAmt) as NetPay
from @DateTable Where len(BankName) > 0 and (TotalPay -PaidAmt) > 0 and len(AcNo) > 0 Order by BankName



VB6/ASP.NET
------------------------
http://www.nehasoftec.com

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-06-17 : 17:08:30
SELECT RegNo,FName,BankAcName,BankName,BankBranch,AcNo,IFSC,AcType ,(TotalPay -PaidAmt) as NetPay
FROM @DateTable
WHERE BankName like '%' + @bName+ '%' AND len(BankName) > 0 and (TotalPay -PaidAmt) > 0 and len(AcNo) > 0
ORDER BY BankName
Go to Top of Page

ravininave
Posting Yak Master

111 Posts

Posted - 2010-06-17 : 17:22:55
Thanx for quick reply. Again Thanx it works. It solves my prob.
Go to Top of Page
   

- Advertisement -