Extraction Functions
Retrieve specific components from dates, times, and strings.
Unit
Description
EXTRACT( unit FROM <datetime expr> )
> select extract(MINUTE FROM cast('2022-01-02 12:27:11' as timestamp))
27DATEPART( unit, <expr> )
WEEK( <date_or_timestamp_expr> )
YEAR( <date_or_timestamp_expr> )
MONTH( <date_or_timestamp_expr> )
DAYS( <date_or_timestamp_expr> )
LAST_DAY( <date_or_timestamp_expr> )
DAYNAME( <date_or_timestamp_expr> )
HOUR( <date_or_timestamp_expr> )
MINUTE( <date_or_timestamp_expr> )
SECOND( <date_or_timestamp_expr> )
DAYOFWEEKISO( <date_or_timestamp_expr> )
WEEKOFYEAR( <date_or_timestamp_expr> )
WEEKISO( <date_or_timestamp_expr> )
Last updated
