Skip to main content
Version: 0.0.1

WEEKOFYEAR

Categories: Date/Time

WEEKOFYEAR

Returns the week of year of the date or timestamp.

Syntax

WEEKOFYEAR(date_timestamp_expression string) → bigint

  • date_timestamp_expression: A DATE or TIMESTAMP expression.

Examples

{{< codeheader "WEEKOFYEAR example" >}}

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

{{< codeheader "WEEKOFYEAR example" >}}

SELECT "Date", WEEKOFYEAR("Date") 
FROM Samples."samples.dremio.com"."SF_incidents2016.json"
LIMIT 3

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