DAYOFMONTH

functionsupportedCore SQL functions

docs.snowflake.com ↗

Date & time functions

Extracts the corresponding date part from a date or timestamp. These functions are alternatives to using the DATE_PART (or EXTRACT) function with the equivalent date part (see Supported date and time parts).

Syntax

YEAR( <date_interval_or_timestamp_expr> )

YEAROFWEEK( <date_or_timestamp_expr> )
YEAROFWEEKISO( <date_or_timestamp_expr> )

DAY( <date_interval_or_timestamp_expr> )

DAYOFMONTH( <date_or_timestamp_expr> )
DAYOFWEEK( <date_or_timestamp_expr> )
DAYOFWEEKISO( <date_or_timestamp_expr> )
DAYOFYEAR( <date_or_timestamp_expr> )

WEEK( <date_or_timestamp_expr> )

WEEKOFYEAR( <date_or_timestamp_expr> )
WEEKISO( <date_or_timestamp_expr> )

MONTH( <date_interval_or_timestamp_expr> )

QUARTER( <date_or_timestamp_expr> )

Parameters

NameRequiredDescription
date_or_timestamp_exprrequiredA date or a timestamp, or an expression that can be evaluated to a date or a timestamp.
date_interval_or_timestamp_exprrequiredA date, an interval, or a timestamp, or an expression that can be evaluated to a date, an interval, or a timestamp. When an interval value is passed to the function, the YEAR and MONTH functions support a year-month interval, or an expression that can be evaluated to a year-month interval. The DAY function supports a day-time interval, or an expression that can be evaluated to a day-time interval.

Returns

This function returns a value of type NUMBER.

Usage notes

See also