function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RbnRbn 

validation on Two Date Fields

Hi,

 

I have a date field called Issue Date & another date field Expiry date.

 

 

My req is that expiry date should be more than 1 year of issue date. 

 

I am writing the below validation rule..

 

DAY(Expiry_Date__c ) < 365

 

But i the validation not working correctly.

 

Thanks in advance.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Discuss with meDiscuss with me

( ( Expire_Date__c ) - ( Issue_dtae__c ) ) <365

 

or

 

(YEAR ( Expire_Date__c ) -YEAR ( Issue_dtae__c ) ) <1

All Answers

Discuss with meDiscuss with me

( ( Expire_Date__c ) - ( Issue_dtae__c ) ) <365

 

or

 

(YEAR ( Expire_Date__c ) -YEAR ( Issue_dtae__c ) ) <1

This was selected as the best answer
RbnRbn
Thanks for the quick reply....