I need to make a temporary table that holds of range of dates, as well as a couple of columns that hold placeholder values (0) for future use. The dates I need are the firs
Create a table variable containing a date for each month in a year:
declare @months table (reportMonth date, PRIMARY KEY (reportMonth));
declare @start date = '2018', @month int = 0; -- base 0 month
while (@offset < 12)
begin
insert into @reportMonths select dateAdd(month, @offset, @start);
select @offset = @offset + 1;
end