Possible Duplicate:
Convert Month Number to Month Name Function in SQL可能重复:在SQL中将月号转换为月份名称函数
Hi ....
嗨....
how can i get month name by passing corresponding month number in sql server 2008 ..
如何通过在sql server 2008中传递相应的月份数来获得月份名称..
thnks in advance....
先提前......
1 个解决方案
#1
5
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
.
此值将返回表EMPLOYEE中JoinDate字段中与日期值对应的月份名。
#1
5
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
.
此值将返回表EMPLOYEE中JoinDate字段中与日期值对应的月份名。