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.
weekday(date)
weekday(timestamp)
weekday(appointment)
number
1
weekday(date(2021, 12, 31))
Result: 4 (= Friday)
1
weekday(today())
Result: 4 (= Friday, on Dec 31, 2021)
1
if weekday(date1) > 4 then "Weekend" else "Business day" end;
Result: Weekend (on May 1, 2021) with date1 being a field in your table.
Last modified 1yr ago