Name
WeekdayName Function
Syntax
WeekdayName(WeekdayNo, [abbreviate[,FirstDayOfWeek]])
-
WeekdayNo Use: Required
Data Subtype: Long
The ordinal number of the required weekday, from 1 to 7.
-
abbreviate Use: Optional
Data Subtype: Boolean
Specifies whether to return the full day name or an abbreviation.
-
FirstDayOfWeek Use: Optional
Data Subtype: Integer
Specifies which day of the week should be first.
Return Value
A Variant of subtype String.
Description
Returns the real name of the day.
Rules at a Glance
WeekDayNomust be a number between 1 and 7, or the function generates runtime error 5, “Invalid procedure call or argument.”If
FirstDayOfWeekis omitted,WeekdayNametreats Sunday as the first day of the week.The default value of
abbreviateisFalse.
Programming Tips & Gotchas
You’d expect that, given a date,
WeekDayNamewould return the name of that date’s day. But this isn’t how the function works. To determine the name of the day of a particular date, combineWeekDayNamewith a call to theWeekDayfunction, as the following code fragment shows:sDay = WeekDayName(Weekday(dDate, iFirstDay), _ bFullName, iFirstDay)Note that the value of the
FirstDayOfWeekargument must be the same in the calls to both functions forWeekDayNameto return an accurate result.
See Also
| Weekday Function |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access