I have several database tables that store the month as an integer value in a field. I am constantly looking for a quick and easy way to display the month name instead of the month number in my report, and I think I have finally found it.

DECLARE @month int = 5

PRINT DATENAME(MONTH, DATEADD(MONTH, @month, –1))

 

Advertisements