MONTH() Function in SQL Server

Rumman Ansari   Software Engineer   2023-03-25   5476 Share
☰ Table of Contents

Table of Content:


Syntax:


Month()

Returns the 'Month number of the year' of the given date.

Code:


Select Month(GETDATE())

Returns the Month number of the year, based on the current system date and time.


Select Month('01/31/2012') 

Output:

The above code will produce the following result-


1