I need to display only the month and year from a Datetime
field in SQL Server 2008.
This should be formatted in the following way:
Jan 13
Feb 13
March 13
etc
I also need to group by and order by these results
I've tried many permutations of Cast
, Convert
, DatePart
etc but can't quite get what I need.
Any suggestions?
SELECT FORMAT(GETDATE(), 'MMM yy')