SQL Server MONTH() Function

Posted by

SQL Server

MONTH()

Function

Example

Return the month part of a date:

SELECT MONTH(‘2017/08/25’) AS Month;


Definition and Usage

The MONTH() function returns the month part for a specified date (a number from 1 to 12).

Syntax

MONTH(

date

)

Parameter Values

Parameter Description

date
Required. The date or datetime to extract the
month from

Technical Details

Works in: SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data
Warehouse, Parallel Data Warehouse

More Examples

Example

Return the month part of a date:

SELECT MONTH(‘2017/05/25 09:08’) AS Month;