Skip to main content
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
  • Possible values: 0 through 23
  • 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.

Examples

Extract a component

NULL input

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.
  • Inputs outside the supported calendar range can return NULL. YEAR and MONTH support a wider range than other fields.
Last modified on October 15, 2026