I have the following scenario. I need the last days of any month from 2013 till today.
How can I combine these two sql statements?
SELECT DATEADD(m, 0, GETDATE()) --today
SELECT DATEDIFF(m, '2013-01-01', GETDATE()) --60 months for 5 years
I need this result:
LastDayOfMth
=======================
2013-01-31 00:00:00.000
2013-02-28 00:00:00.000
2013-03-31 00:00:00.000
2013-04-30 00:00:00.000
2013-05-31 00:00:00.000
....
2017-12-31 00:00:00.000