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