I have tried IsNull, Case statements and searched online, but for some reason if no records are found it still doesn't show a record or replace it with a '0' I'm trying to get all of the Types from the table and display how many have been done within a date range.
Here is my code so far.
SELECT ISNULL(COUNT(Type), 0) AS Total, Type
FROM dbo.Refs
WHERE (DateSubmitted BETWEEN CONVERT(DATETIME, '2014-02-01 00:00:00', 102) AND CONVERT(DATETIME, '2015-01-01 00:00:00', 102))
GROUP BY Type
The Type column is a varchar to unfortunaltey
Thanks