Skip to main content
Returns the quarter part of a date, in the range of 1 to 4.

Syntax

Parameters

date: It must be of the DATETIME or DATE type.

Return value

Returns an INT value. NULL is returned in any of the following scenarios:
  • The date is not a valid DATETIME or DATE value.
  • The input is empty.
  • The date does not exist, for example, 2022-02-29.

Examples

Example 1: Return the quarter part of a DATETIME value.
Example 2: Return the quarter part of a DATE value.
Example 3: Return the quarter part that corresponds to the current time or date.