Contents
- Overview
- Operators
- Date/Time Field Falls Within the Past X Days (Including Today)
- Date/Time Field Falls Within the Next X Days (Including Today)
- Date/Time Field is X or More Days Before Today
- Date/Time Field Is X or More Days After Today
Overview
This guide will show you how to set up a Relative Date in the routing graph.
Operators
When comparing dates or date/times, you can use the following operators:
| Operator | Description |
| On / At | On a specific date / at a specific time |
| Not on / Not | The date or date/Time is not the same as the field value |
| After | After the date or date/Time |
| On or after / At or after | On or after the date or date/time |
| Before | Before the date or date/time |
| On or before / At or before | On or before a date / at or before a date/time |
| Is Null | The date or date/time field is blank |
| Not Null | The date or date/time field is not blank |
Common Date/Time Comparisons
Checking if a Date/Time Field Falls Within the Past X Days (Including Today)
Replace X with the number of days needed for your specific case.
- Select the date/time field and operator, then click Insert > Relative date
- Set the operator to "On or After"
- Enter the number of days and select "Before Today" to check data from the last X days
- Click "Add Condition" to add a second condition
- Select the same date/time field and set the operator to "On or Before"
- Set the relative date to "Today"
Example: checking if the value is within the last 3 days
1. (Date on or after [!Datetime.daysAfter([!Datetime.today()],-3)])
2. (Date on or before Today)
Rule Logic 1 AND 2
Checking Whether a Date/Time Field Falls Within the Next X Days (Including Today)
Replace X with the number of days needed for your use case.
- Select the date/time field and operator, then click Insert > Relative date
- Set the operator to "On or before"
- Enter the number of days and select "After Today"
- Click "Add Condition"
- Select the same date/time field and set the operator to "On or after"
- Set the relative date to "Today"
Example: checking if the value is within the next 3 days
1. (Date on or before [!Datetime.daysAfter([!Datetime.today()],3)]
2. (Date on or after Today)
Rule Logic 1 AND 2
Checking if a Date/Time Field is X or More Days Before Today
Replace X with the number of days needed for your use case.
- Select the date/time field and operator, then click Insert > Relative date
- Set the operator to "On or Before"
- Enter the number of days and select "Before Today" to check dates that are X or more days in the past
Example: checking if the value is 3 days or more before today
1. (Date on or before [!Datetime.daysAfter([!Datetime.today()],-3)])
Checking if a Date/Time Field Is X or More Days After Today
Replace the number of days in X as needed for your use case.
- Select the date/time field, operator, and click on Insert > Relative date
- The operator must be "On or After"
- Put the number of days, select "After" Today to check the data from the Last X number of days
Example: checking if the value is 3 days or more after today
1. (Date on or after [!Datetime.daysAfter([!Datetime.today()],3)])
For questions or additional assistance please contact LeanData Support.