Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
The WEEKOF function returns an INTEGER in the range of 1 to 53, which gives the week of the year in which a specified date falls. The result has the same dimensions as the specified DATE expression.
Return Value
INTEGER
Syntax
WEEKOF(date-expression)
Arguments
An expression that has the DATE data type, or a text expression that specifies a date. See "TEXT-to-DATE Conversion".
Notes
In place of a DATE expression, you can specify a text expression that has values conforming to a valid input style for dates. Oracle OLAP automatically converts the values of the text expression to DATE values, using the current setting of the DATEORDER option to resolve any ambiguity.
The value of WEEKDAYSNEWYEAR specifies how many days of the new year there must be in the week for WEEKOF to consider it to be week 1 of the new year. For example, when January 1 is on a Wednesday, then the week of December 29 to January 4 has four days in the new year. WEEKDAYSNEWYEAR must therefore have a value of 4 or less for that week to be counted as week 1. This determination of week 1 affects the numbering of all weeks in the year.
Examples