To generate a monthly calendar that starts from your start date and goes through the end date, you can use the master..spt_values (or a numbers table if you have one in your database). For example:DECLARE @start_date DATETIME, @end_date DATETIME;SET @start_date = '20120101';SET @end_date = '20121231';SELECT DATEADD(MONTH,Number,@start_date)FROM MASTER..spt_valuesWHERE [Type] = 'P' AND DATEADD(MONTH,Number,@start_date) < @end_date
That may be required if you don't have data for all the months in between the start and end date and you still want to display those months.