How can I get the month number in sql? I use the following code but it returns the month name.
SELECT DATENAME(mm, GETDATE())
Use the month function - SELECT MONTH(GETDATE())
SELECT MONTH(GETDATE())