WEEK

Purpose

This function returns the week of a date (values 1-53, specified in ISO-8601 standard).

Syntax

week::=

Usage Notes

  • A new week begins with Monday.
  • The first week of a year starts from January 1st, if it is a Monday, Tuesday, Wednesday or Thursday - otherwise on the following Monday.
  • For data type TIMESTAMP WITH LOCAL TIME ZONE this function is calculated within the session time zone.

Example

SELECT WEEK(DATE '2012-01-05') WEEK;