Scalar function
Returns NULL for NULL input. Some date/time components also return NULL when the input is outside their supported calendar range.
Syntax
Scalar
Arguments
Returns
- Type: INTEGER
- NULL behavior: Returns NULL for NULL input. Some date/time components also return NULL when the input is outside their supported calendar range.
Properties
Usage notes
- Returns an INTEGER component, or NULL for a NULL input.
- YEAR and MONTH can extract components from a wider range of UTC or timezone-free dates than other fields.
Examples
Limitations
- String inputs require conversion to a date or timestamp. Use the formats shown here; the example does not cover every date or time format.
Last modified on October 15, 2026