WeekdayName
Returns a string indicating the specified day of the week.
Syntax
WeekdayName(<value> [, <abbreviate> [, <locale> ] ])
Parameters
<value>
Type: None
A integer between 1 and 7 representing the day of the week, or a date. The input locale defines which days are considered the first and last days of the week.
<abbreviate>
Type: Boolean
(Optional.) Whether a short form of the day name is to be used. The default value is False.
<locale>
Type: Long
(Optional.) The output locale to use for regional variations in day names. If Locale is omitted or negative, or does not match a known Locale ID (LCID), the current output locale is used.
(return)
Type: Text
The name of the day, as specified for the output locale.
Notes
If <locale> is specified, it is not used for error messages.
If <value> is NULL, the return value is a zero-length string. Otherwise, an error occurs if <value> is not in the range 1 to 7 or is not a valid date.
Examples
This example returns the full name of the third day of the week. If the first day of the week is defined as Sunday, this example would return “Tuesday”.
WeekdayName(3)
To return the abbreviated weekday name, set <abbreviate> to True. If the first day of the week is defined as Sunday, this example would return “Tue”.
WeekdayName(3, True)
To return the day name for a locale, set <locale> to a Locale ID (LCID) number. In the following example, the Arabic name for the 4th day is returned.
WeekdayName(4, , 1025)
The following SQL query uses the WeekdayName function to return the name of the day on which interviews were completed:
SELECT Respondent.Serial,
DataCollection.FinishTime,
WeekdayName(DataCollection.FinishTime) AS Day
FROM vdata
WHERE DataCollection.Status = {Completed}
Here are the results for the first five respondents:
Respondent.Serial DataCollection.FinishTime Day
----------------- ------------------------- -----------
6 16/10/2002 13:57:03 Wednesday
7 16/10/2002 18:23:12 Wednesday
8 16/10/2002 22:23:47 Wednesday
9 17/10/2002 02:24:05 Thursday
10 17/10/2002 06:24:00 Thursday
See also