I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL
declare @month int set @month = 11 -- November Select 'Month Name' = DateName( month , DateAdd( month , @month , 0 ) - 1 )
select DATENAME(MONTH, getdate() ) select DATENAME(MONTH, DateAdd( month , 11, 0 ) - 1 ) -- 11 as month value select DATENAME(MONTH,250 ) --- pass values from 1-365 days
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)