Weekday function
Returns an integer that represents the day of the week.
Weekday(date, [firstdayofweek])
Parameters
Date
An arbitrary expression that can represent a date. If NULL is included in the date argument, nullis returned.
FirstDayOfWeek
Specifies the constant for the first day of the week. If omitted, vbsundayis used by default.
Set up
The FirstDayOfWeek parameter has the following settings:
Constants |
value |
Description |
Vbusesystem |
0 |
Use the regional language Support (NLS) API settings. |
Vbsunday |
1 |
Sunday |
Vbmonday |
2 |
Monday |
Vbtuesday |
3 |
Tuesday |
Vbwednesday |
4 |
Wednesday |
Vbthursday |
5 |
Thursday |
Vbfriday |
6 |
Friday |
Vbsaturday |
7 |
Saturday |
return value
The weekday function returns the following values:
Constants |
value |
Description |
Vbsunday |
1 |
Sunday |
Vbmonday |
2 |
Monday |
Vbtuesday |
3 |
Tuesday |
Vbwednesday |
4 |
Wednesday |
Vbthursday |
5 |
Thursday |
Vbfriday |
6 |
Friday |
Vbsaturday |
7 |
Saturday |
Description
The following example uses the weekday function to get the specified date as the day of the week:
Dim MyDate, MyWeekDayMyDate = #October 19, 1962#
Dispatch date. Weekday(MyDate) '
due to the
inclusion
represents Friday.