How can I get the month number (not month name) from a date in SQL Server?

前端 未结 7 1581
孤街浪徒
孤街浪徒 2021-02-02 08:37

How can I get the month number in sql? I use the following code but it returns the month name.

SELECT DATENAME(mm, GETDATE())
7条回答
提交回复
热议问题