Type
Date Function

Purpose
The yearweek function calculates the week number (1-53) of a date value.

Syntax
yearweek( DATE VALUE)

Returns
An integer value from 1 to 53 (inclusive). The date format selected in Windows Control Panel changes the date sequence but does not affect which value is returned by a Date function.

Usage
This yearweek function always counts January 1st-7th as Week1, January 8th-14th as Week 2, etc. In a non-Leap Year, the only day in Week 53 is December 31st. In a Leap Year, December 30th is also counted in Week 53 (all dates following February 28 are affected by leap year).

Examples
yearweek( 01/01/99)
Returns: 1

yearweek( 12/30/99)
Returns: 52 ( most North American formats)

yearweek( 30/12/99)
Returns: 52 ( most European formats)

yearweek( 99/12/30)
Returns: 52 (_____parentheses_ Metric format)_____parentheses_

yearweek( DATE)
Converts the day portion of the value in the DATE field into an integer from 1 to 53, representing the week of the year, for every record processed. If a record contains the value 12/30/96 (a Leap Year) in the DATE field, the function returns 53.