Skip to main content
Scalar function
Aliases: day Returns NULL for NULL input. Some date/time components also return NULL when the input is outside their supported calendar range.

Syntax

Scalar

Day form (scalar)

Arguments

Scalar, day form

Returns

  • Type: INTEGER
  • Possible values: 1 through 31
  • 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.
  • DAY is an alias of DAYS. Both take one DATE or TIMESTAMP argument.

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