sql server 2008 中的月份名称

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4301603/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 08:25:13  来源:igfitidea点击:

Month name in sql server 2008

sqlsql-server

提问by Nithesh Narayanan

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....

提前谢谢....

回答by Jaykay

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

Ex:

前任:

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

This value would return the monthnamecorresponding to the date value in the field JoinDatefrom the table EMPLOYEE.

此值将返回MONTHNAME对应于该领域的最新值JoinDate从表中EMPLOYEE