Skip to main content
Dean Salvestrin 님이 #Formulas에 질문했습니다
Hi,

I have setup 2 date fields e.g. Date1 and Date2 and trying to work out how best to setup a validation rule.

Date1 will be set with a date. 

Date2 must be at least 14 days greater than Date1. How would would you set this up?

Date2 < Date1?

Thanks,

Dean
답변 1개
  1. 2017년 8월 17일 오전 3:34
    Dean,

    Assuming you have Date2 and Date1 as the 2 Date value custom fields, you can use the following formula in the Error Condition Formula of your validation rule to enforce the said mandate.

     

    Date2__c - Date1__c <= 14

    The difference between the two dates is expressed as days. In case it provides a decimal value you can use the ROUND function to round the decimal values and get the number of days as a whole number for comparison.

    Please do not forget to mark this thread as SOLVED if this answer helps resolve your issue.
0/9000