SELECT isnull(SUM(amount),0) as amount from getbillsfortaxinvoice WHERE code IN ('TT') and fno = '02112017416202742' and bill_desc not like '%GST%' GROUP BY folio_Id,room_no,guest_name
MSDN wrote:SUM can be used with numeric columns only. Null values are ignored.
isnull(SUM(amount),0)
SUM(ISNULL(amount,1))
SELECT ISNULL(SUM(AMOUNT),0) FROM(SELECT isnull(SUM(amount),0) as amount from getbillsfortaxinvoice WHERE code IN ('TT') and fno = '02112017416202742' and bill_desc not like '%GST%' GROUP BY folio_Id,room_no,guest_name) as X
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)