I have a recursive query that creates a row for each hour of the previous month as follows;
WITH a AS ( SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE(