Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 month number to month name

Author  Topic 

Mageshkumar
Starting Member

29 Posts

Posted - 2008-09-02 : 04:46:51
Hi if i give month number it have to return month name

ex: if i give 6 it have to come jun

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-02 : 04:50:25
declare @month int
set @month=6
select datename(month,dateadd(month,@month-1,0))


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -