Link Search Menu Expand Document

TO_QUARTER

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

Syntax

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

Example

For Tuesday, April 22, 1975:

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

Returns: 2