Weekday

Description

Returns an integer value representing the weekday for a given date

Syntax

WEEKDAY(<inputdate>, [firstdayofweek], [iszerobased])

Arguments

Argument Type Description Optional
inputdate DateTime Date value to extract the weekday from No
firstdayofweek Integer Specifies which day is the used as the first day of the week Yes – Default = Sunday (0)
iszerobased Boolean Determines whether the return value is zero based, i.e. the first day of the week = 0 Yes – Default = True

firstdayofweek

Value Description
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Returns

Integer value

Examples

Expression: WEEKDAY("2016-01-17")
Returns: 0
Expression: WEEKDAY("2016-01-17", 1)
Returns: 6
Expression: WEEKDAY("2016-01-17", 1, False)
Returns: 7

Download

Download Example