WEEK_NR

Use the WEEK_NR script function to return the calendar week of a particular date. The calendar week is returned as a 3-digit value.

Note: Calendar week calculation depends on the definitions made for the first calendar week of the year. Administrators define the starting week of the year in the UC_CLIENT_SETTINGS variable, using the FIRST_WEEK_METHOD and FIRST_DAY_OF_WEEK keys. For more information, see UC_CLIENT_SETTINGS - Various Client Settings.

Syntax

WEEK_NR ([DateFormat:]Date)

Parameters

Parameter Description Format
Date Specifies the date for which to determine the calendar week. Specify the date format when you use a format other than YYMMDD or YYYYMMDD, separating the format and the date with a colon or semicolon. For more information, see Date, Time and Period Formats in Scripts. Script literal or script variable

Examples

The following example returns the value 052 as the calendar week for the specified date. Because the date uses the default YYMMDD format, no date format prefix is required.

: SET &CW# = WEEK_NR ("991231")

See also: