Hi there,
maybe anyone can help me out with my SELECT statement on MS SQL Server. I am not very skilled in (T)SQL.
I have a table called RECORDS and with a DATETIME column called [BEGIN]. Now I would like to get some nvarchars which look like this "December 08, January 09, February 09"..
I came up with the following myself.
SELECT DISTINCT DATENAME(MONTH, [BEGIN]) + ' ' + SUBSTRING(DATENAME(YEAR, [BEGIN]),3,4)
FROM RECORDS
However this is unsorted I would like to have the result set ordered from first to last.
February 09
January 09
December 08
Anyone?