weekday

To return the weekday of a given date value as a number

With this function, you can determine the corresponding weekday from a date value.

The weekday is a number with Monday = 0, Tuesday = 1, ... Sunday = 6.

Therefore, you can check if a particular date should be a workday (for example Monday to Friday) or a weekend day.

Note: It's not taking specific holidays into account.

You can use all data types containing a date.

Syntax

weekday(date)

weekday(timestamp)

weekday(appointment)

Return

number

Examples

weekday(date(2021, 12, 31))

Result: 4 (= Friday)

weekday(today())

Result: 4 (= Friday, on Dec 31, 2021)

if weekday(date1) > 4 then "Weekend" else "Business day" end; 

Result: Weekend (on May 1, 2021) with date1 being a field in your table.

See also

weedayIndex, which returns a given weekday name as a number.

weekdayName, which returns the full weekday name of a given date value.

Last updated