Skip to content
Related Articles

Related Articles

Weekday() and WeekdayName() Function in MS Access

Improve Article
Save Article
Like Article
  • Last Updated : 23 Sep, 2020

1. Weekday() Function :
In MS Access, The weekday() function returns the weekday number for a given date. In this function, a date will be passed as a parameter and it returns the weekday of that date. By default the 1 is denoted for Sunday and 7 for Saturday. The second parameter will be optional it will be the first day of the week.

Syntax :

Weekday(date, firstdayofweek)

Parameters Value :

ParameterDescription
dateIt is required. A valid date.
firstdayofweekoptional, it will specifies the first day of the week
0 : For NLS API setting
1 : Sunday (default)
2 : Monday
3 : Tuesday
4 : Wednesday
5 : Thursday
6 : Friday
7 : Saturday

Example-1 :

SELECT Weekday(#06/17/2020#);

Output :

4

Example-2 :

SELECT Weekday(Date());

Output :

5

2. WeekdayName() Function :
In MS Access, the WeekdayName() function returns the weekday name. In this function, the first function will be the week number and the second parameter will be abbreviate.it is optional. If you want abbreviation then pass true otherwise pass false. and the third parameter will be the first day of the week. It is also optional.

Syntax :

WeekdayName(number, abbreviate, firstdayofweek)

Parameters :

ParameterDescription
numberIt is required. It will be in the range of 1 to 7
abbreviateOptional.For abbreviation true otherwise false
firstdayofweekoptional, it will specifies the first day of the week
0 : For NLS API setting
1 : Sunday (default)
2 : Monday
3 : Tuesday
4 : Wednesday
5 : Thursday
6 : Friday
7 : Saturday

Example-1 :

SELECT WeekdayName(1);

Output :

Sunday

Example-2 :

SELECT WeekdayName (3, TRUE, 2)

Output :

Wed
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!