TSQL: function to display the month in words not numbers

MONTH(CMS.App_Received_Date) as 'App Month' 

will return 4 for April when the date is similar to 2012-04-01

will return 5 in May when the date is similar to 2012-05-02 , etc.

Is there a TSQL function to return in April, May, June?

i.e. MONTHNAME(CMS.App_Received_Date) as 'App Month'

+4
source share
2 answers
 DATENAME(month, CMS.App_Received_Date) as 'App Month' 
+5
source
 SELECT DATENAME(month, '2012-04-01') AS 'App Month' 

Returns a character string that represents a given date on a specific date.

Please note that the return value depends on the language environment, in my case it returns Januar (German).

http://msdn.microsoft.com/en-us/library/ms174395.aspx

+3
source

Source: https://habr.com/ru/post/1414453/


All Articles