ANSI | DB2 | SQL/DS | XDB |
---|---|---|---|
X |
This function is used to obtain the number of weeks (1-53) since the beginning of the year for the specified date. The format appears below:
WEEKOFYEAR(date)
The number of weeks is determined by the number of Sundays. The function starts at week one and adds a week every time a Sunday occurs. For example, if January 6, 1991, is a Sunday:
WEEKOFYEAR(1/5/1991) = 1 WEEKOFYEAR(1/6/1991) = 2 WEEKOFYEAR(1/7/1991) = 2