Get the current month number in SQL Server, 1 for january, 12 for december

AnandMeena

How can I get current month in number in SQL Server?

Means for January I want 1 and for December I want 12.

marc_s

How about this:

SELECT MONTH(GETDATE())

This will return values 1 through 12 depending on the month.

See the relevant MSDN documentation for details - that entire documentation site is freely available for consultation by everyone - use it!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Get the number of days in the current month in Java

First business day of the current month - SQL Server

How to get the number of hours since the start of January 1 of the current year?

MS SQL How to get the next month if its december

How to get only current year of 12 month in sql server?

How to get number of days in a month in SQL Server

Get 12 month name with data count using SQL Server?

Get every month of the current year in SQL Server

How to sort the month list from January to December in angular?

How does PowerShell handle ((Get-Date).Month)-1 in January?

Output value from Pervious Month (December) in January

Converting month name to month number in SQL Server

Convert 1 to 12 (number type) to January to December using just Power Query and not with DAX

SQL Server - Get All Month and Year numbers till current month from the Month and Year of joining

How to get a date (month, day, year) from the number of seconds passed since January 1, 1970 in Lua?

How to get current identity number of specific table in sql server compact

SQL Server: get current month and previous months

Get the month and year now then count the number of rows that are older then 12 months in SQL/Classic ASP

How to get the date one month before from current date, when current date is January?

get all record of last month with respect to current month in sql server

How to get number of weeks in a current month?

SQL Server : get row order number in given month

Get the current week number in month from Date

How to get previous 12 months data in SQL Server and avoiding the current month

how to get all weeks in january to december in sql

Sort Months from January to December in SQL

How can I get the 1st of January and the 31st of December three years ago with VB.Net or C#

to get a unique record month wise using row number in sql server

Get the number of records of data in the current month