Altair® Monarch®

 

Function: Weekday

Description

Returns the day of the week (1-7), where each week is assumed to begin on a designated day (e.g., Tuesday is the third weekday if weeks are designated to begin on Sunday, but Tuesday is the second weekday if weeks are designated to begin on Monday).

Syntax

Weekday(date[,startday])

Arguments

date may be any valid date in the range 1/1/1601-12/31/2400.

startday is an optional argument that designates the day that begins each week. This value may be in the range 1 (representing Sunday) to 7 (representing Saturday).

Note: If the startday argument is omitted, Sunday is assumed to be the first day of the week.

Return value

This function returns a number in the range 1-7, representing the relative offset starting with the day that has been designated to begin the week (e.g., if weeks begin on Sunday, 1 represents Sunday, 2 represents Monday, etc).

Calculated field example

If you were reading this help message on June 7, 2007, the following function would return the value 5, indicating that June 7, 2007 is a Thursday:  Weekday(Today())

Filter/Find example

Records representing long distance telephone calls placed on weekend days can be selected or found using the expression: Weekday(Call_date)=1.Or.Weekday(Call_date)=7