Question : Function to change the month from numeric to string

Hi all,

I need some example how to do a function in SQL Server 2005 to use in a view.
The function is to change the month from numeric to string, like:

1 = January
...
12 = Dezember

I will like to retrive from some views the full name instead of the number. Any example or link will be nice


Thanks in advance

Answer : Function to change the month from numeric to string

Or:

Declare @YourMonth tinyint
Set @YourMonth = 1
Select DATENAME (month, '1900-' + CAST(@YourMonth as varchar(2)) + '-01')

Set @YourMonth = 12
Select DATENAME (month, '1900-' + CAST(@YourMonth as varchar(2)) + '-01')
Random Solutions  
 
programming4us programming4us