Returning Month Name in SQL Server Query
Have you tried DATENAME(MONTH, S0.OrderDateTime)
?
Change:
CONVERT(varchar(3), DATEPART(MONTH, S0.OrderDateTime) AS OrderMonth
To:
CONVERT(varchar(3), DATENAME(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)
Try this:
SELECT LEFT(DATENAME(MONTH,Getdate()),3)