I have below query which works fine, it displays all the values for that particular location how much was the refund amount. However, if I want to show monthly report, I need to show those days were no refund is there in my Table 1 and display zero values for the same:
SELECT businessDate AS 'Business Date'
,Sum(convert(DECIMAL, ISNULL(T1.Amount, 0)) * 1) AS 'Refund Amount'
FROM table1 T1
WHERE (
(T1.id = '1')
AND (T1.businessDate BETWEEN '20160201' AND '20160229')
AND (T1.Amount IS NOT NULL)
)
GROUP BY T1.businessDate
my Current output is:
Business Date Refund Amount
20160202 14
20160203 19
It should be:
Business Date Refund Amount
20160201 0
20160202 14
20160203 19
so how to fix my query to cater the above??