Previous Topic

Next Topic

Book Contents

Book Index

%%$WEEK#

The %%$WEEK# function calculates in which week of the year (1 through 54) a specified date falls. The function uses the site-defined start of the week (Sunday or Monday) as the first day of each week, and assumes that January 1st falls in the first week.

This function ensures that every day of the year falls into a week of that year, but it also means that the first week of the year may possibly have a majority of its days come from December of the preceding year.

(By contrast, the %%$YEARWK# AutoEdit function, which also calculates in which week of a year a date falls, counts the week that includes January 4th as the first week. This ensures that the first week in the year has a majority of its days in January. However, it also means that the first days of the year may possibly belong to the last week of the preceding year, and the last days of the year may possibly belong to the first week of the following year.)

The format of the %%$WEEK# function is:

%%$WEEK# date

where date is the date in format yyyymmdd (a 4-character year must be specified).

Example

//* %%SET %%A=%%$WEEK# 20010712

%%A is assigned a value of 28

Parent Topic

Functions