InLast4WeeksToSunday - Built-in Date & Time Function¶
Purpose¶
Returns true if the passed date falls in the last four weeks ending the last Sunday. If the current date is 2023-08-20, any date passed that is between 2023-07-21 and 2023-08-17 is valid.
Syntax¶
InLast4WeeksToSunday(datetime)
Arguments¶
| Argument | Required | Description |
|---|---|---|
datetime |
Yes | Any valid date expression |
Returns¶
Boolean
See also¶
- Date
- DateAdd
- DateDiff
- DatePart
- DateValue
- DateSerial
- Day
- Hour
- InAgedToDays
- InLast7Days
- InLastFullMonth
- InLastFullWeek
- InLastYearMTD
- InLastYearYTD
- InLeapYear
- Minute
- Month
- MonthName
- Now
- Second
- Time
- TimeSerial
- TimeValue
- WeekAgo
- Weekday
- WeekdayName
- Year
Examples¶
Used in a Font Color function¶
If InLast4WeeksToSunday({OrderHeader.Order_Date}) Then
Return drBlack
Else
Return drRed
End
Used in a filter function¶
return InLast4WeeksToSunday({OrderHeader.Order_Date})
Notes¶
- When the argument cannot be converted to a datetime value, a runtime error is generated.