How can I get the last 12 months date as of today ?
Ex:
2020-10-21
2020-09-21
2020-08-21
2020-07-21
2020-06-21
2020-05-21
2020-04-21
2020-03-21
2020-02-21
2020-01-21
I tried this :
SELECT GETDATE() 'Today',
DATEADD(mm,-1,GETDATE())
But this gives me only last month.
See Question&Answers more detail:os