WITH CTE AS ( SELECT GETDATE() Today UNION ALL SELECT DATEADD(mm, -1, today) FROM CTE WHERE MONTH(Today) > 1 ) SELECT DATENAME(mm, today) FROM CTE ORDER BY MONTH(today)
PIVOT
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)