Skip to main content
Version: I2024.1.3

WeekDay

Returns an integer (1-7) representing the day of the week on which the specified date occurs.

Syntax

WeekDay(Date, [vbWeekStartDayConst])

Parameters

Date
The date to return the week day for.

vbWeekStartDayConst
Optional. String constant indicating the first day of the week (Sunday, Monday, and so on). This parameter supports the following values:

  • vbUseSystem
  • vbSunday
  • vbMonday
  • vbTuesday
  • vbWednesday
  • vbThursday
  • vbFriday
  • vbSaturday

If no value is provided, this parameter defaults to vbSunday.

Example

The following expression returns the week day on which 2007-07-05 occurred, with Monday as the first day of the week:

[DateCustom].[DateInt].[DayInt].&[`Year("2007-07-05T12:30:10")`]&[`Month("2007-07-05T12:30:10")`]&[`WeekDay("2007-07-05T12:30:10","vbMonday")`]