Using SQL Server 2008, I have a query that is used to create a view and I'm trying to display a month's name instead of an integer.
In my database, the datetime is in a column called OrderDateTime. The lines in the query that return the date is:
DATENAME(yyyy, S0.OrderDateTime) AS OrderYear,
DATEPART(MONTH, S0.OrderDateTime) AS OrderMonth
CONVERT(varchar(3), DATEPART(MONTH, S0.OrderDateTime) AS OrderMonth
This will give you the full name of the month.
select datename(month, S0.OrderDateTime)
If you only want the first three letters you can use this
select convert(char(3), S0.OrderDateTime, 0)