WEEK

WEEK function (Date & Time)

Syntax

WEEK(d)

Description

Returns the week number of date d.

Example

  1. WEEK(TO_DATE(‘2011-05-30’, ‘yyyy-MM-dd’))

    This example returns the value 23 for the week number of the specified date.

  2. WEEK(TO_DATE(‘2016-12-31’), ‘yyyy-MM-dd’)

    This example returns the value 53 for the week number of the specified date.

  3. WEEK(TO_DATE(‘2017-01-01’), ‘yyyy-MM-dd’)

    This example returns the value 1 for the week number of the specified date.

  4. WEEK(TO_DATE(‘2017-01-02’, ‘yyyy-MM-dd’))

    This example returns the value 2 for the week number of the specified date.