Start a conversation

Check if a date is before another date and show an error if so

1. Create a calculation field after two date fields. You can choose the variable names yourself, but you will have to change them in the calculation template in step 2.


2. Use this formula for the calculation field. Please note, that date1 should be the older date. If you have chosen other variable names, then you have to replace date1 and date2 with your own variable names. Check this template in the calculation helper here.

var dateDiff = getDateDiff('{date1}','{date2}', 'day');
if(dateDiff < 0 ){
    "No";
} else {
    "Yes";
}

3. Set the calculation field up like this.

     

4. Define a message for the calculation field.


5. The end result when you enter data for a record.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Tonya

  2. Posted
  3. Updated