I am trying to get first date & last date for next 12 months from the date the report/query is run.I was able to get next 12months by using below query but not with first and last dates. Any suggestions on how to do this are appreciated.
SELECT STR(MONTH(DATEADD(mm,Number,GETDATE())),2)+'/'
+ STR(YEAR(DATEADD(mm,Number,GETDATE())),4),DATEPART(MM,'january '+'01 1900')
FROM Master.dbo.spt_values
WHERE NAME IS NULL
AND Number BETWEEN 0 AND 11
But results it gives are:
But what I expect: