Data Type: Date or valid date expression
Any valid date expression
Data Type: Constant of
A constant indicating the first day of the week
Determines the day of the week of a given date
Rules at a Glance
The default for
To determine the day of the week, think of the day specified by
dayofweekas day 1, and the value returned by the function as indicating the day relative to day 1. Then, for example, if the return value of
WeekDayis 2, this specifies the day following
dayofweek. A return value of 1 specifies
dayofweek. A return value of 7 specifies the day before
The members of the
Passing a value of 0 as the
dayofweekargument uses the system’s locale settings to determine the first day of the week.
Since the code:
returns 2, the date 3/26/2001 is a Monday.
Programming Tips and Gotchas
If passing a date literal as
Weekdayfunction requires that all four digits of the year be present.
That the function’s return value is relative to