Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 643 Bytes

File metadata and controls

27 lines (20 loc) · 643 Bytes
description
Returns the day of the year (from 1 to 366) of the date or timestamp.

DAYOFYEAR

Syntax

DAYOFYEAR(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

{% code title="DAYOFYEAR example" %}

SELECT DAYOFYEAR(DATE '2021-02-28')
-- 59

{% endcode %}

{% code title="DAYOFYEAR example" %}

SELECT DAYOFYEAR(TIMESTAMP '2021-03-15 11:43:22')
-- 74

{% endcode %}