Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 714 Bytes

File metadata and controls

33 lines (25 loc) · 714 Bytes
description
Returns the week of year of the date or timestamp.

WEEKOFYEAR

Syntax

WEEKOFYEAR(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

{% code title="WEEKOFYEAR example" %}

SELECT WEEKOFYEAR('2003-02-01 11:43:22')
-- 5

{% endcode %}

{% code title="WEEKOFYEAR example" %}

SELECT "Date", WEEKOFYEAR("Date") 
FROM eth.recent_blocks 
LIMIT 3

-- Date, EXPR$1
-- 2016-01-29, 4
-- 2016-01-29, 4
-- 2016-04-25, 17

{% endcode %}