Check If a Date In a Time Period Is a Particular Day of the Month

The Temporal Once Per Month function returns true if the day is equal to the day-of-month parameter and false on all other days of the month from the specified start date (inclusive) to the end date (exclusive). Note that this function will return uncertain outside of the date range. When the day-of-month exceeds the number of days in the current month, the value is true on the last day of that month. Therefore, the function returns a value that is true exactly one day per month. The syntax for this function is:

  • TemporalOncePerMonth(<start date>,<end date>,<day-of-month>)

For example, to determine if a date is a payday for someone who is paid on the 15th of every month, you could write this rule in Word:

the person is paid today if

TemporalOncePerMonth(2019-03-04, 2019-04-30, 15)

The function returns a value of true for dates that are equal to the specified day of the month and false for all other dates. Where the start date is 4 March 2019 and the end date is 30 April 2019, the value of 'person is paid today' is shown in the following table.

Table 1. Conclusions in a TemporalOncePerMonth rule
Calculation Date the person is paid today
pre 04/03/2019 uncertain
04/03/2019 false
15/03/2019 true
16/03/2019 false
15/04/2019 true
16/04/2019 false
30/04/2019 uncertain