month

Description

Returns an integer that represents the month in the datepart of a specified date.

Syntax

month(date_expression)

Parameters

date_expression

is an expression of type datetime, smalldatetime, date or a character string in a datetime format.

Examples

Example 1

Returns the integer 11:

day("11/02/03")
----------
11

Usage

month(date_expression) is equivalent to datepart(mm, date_expression).

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute month.

See also

Datatypes datetime, smalldatetime, date

Functions datepart, day, year