1

Possible Duplicate:
Convert Month Number to Month Name Function in SQL

Hi ....

how can i get month name by passing corresponding month number in sql server 2008 ..

thnks in advance....

Community
  • 1
  • 1
Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138

1 Answers1

7
SELECT DATENAME(month, <fieldname>) AS "Month Name" FROM <tablename>

Ex:

SELECT DATENAME(month, JoinDate) AS "Month Name" FROM EMPLOYEE

This value would return the monthname corresponding to the date value in the field JoinDate from the table EMPLOYEE.

Prahalad Gaggar
  • 11,389
  • 16
  • 53
  • 71
Jaykay
  • 666
  • 1
  • 4
  • 17