Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 639 Bytes

File metadata and controls

27 lines (20 loc) · 639 Bytes
description
Returns the day of the week (from 1 to 7) of the date or timestamp.

DAYOFWEEK

Syntax

DAYOFWEEK(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

{% code title="DAYOFWEEK example" %}

SELECT DAYOFWEEK(DATE '2021-02-28')
-- 1

{% endcode %}

{% code title="DAYOFWEEK example" %}

SELECT DAYOFWEEK(TIMESTAMP '2021-02-27 11:43:22')
-- 7

{% endcode %}