Link Search Menu Expand Document

TO_MONTH

Converts a date or timestamp (any date format we support) to a number containing the month.

Syntax

TO_MONTH(<date>)
Parameter Description
<date> The date or timestamp to be converted into the number of the month.

Example

For Tuesday, April 22, 1975:

SELECT
	TO_MONTH(CAST('1975/04/22' AS DATE)) AS res;

Returns: 4