You are using a LEFT JOIN and you also have where-criteria that filters in the right table. Try this and see what you get:SELECT isnull(SUM((ISNULL(dbo.CustomerBillItem.qtya,0)* ISNULL(dbo.customerbillitem.pricea,0)) + (ISNULL(dbo.CustomerBillitem.qtyb,0) * ISNULL(dbo.customerbillitem.priceb,0))),0)FROM dbo.CustomerBillItem LEFT JOIN dbo.CustomerBillNo ON dbo.CustomerBillItem.CBillID = dbo.CustomerBillNo.CBillID and (dbo.CustomerBillNo.BillDate between '2012-04-26' and '2012-04-27') and dbo.CustomerBillitem.ItemID = 'FR4523-544' and dbo.CustomerBillItem.Status = '1' and dbo.CustomerBillNo.Status = '1'
- LumbagoMy blog-> http://thefirstsql.com/2011/07/08/how-to-find-gaps-in-identity-columns-at-the-speed-of-light/