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
TOny MANEROTOny MANERO 

A date between 2 dates

Can someone help me with this formula? I need to check if a date field is between 2 dates fields.

"check that the date of performance is between the start and end date of the policy." Thanks in advance
Anthony McDougaldAnthony McDougald
Hello Tony,
Hope that your day is off to an amazing start. Below is an example of an IF formula that can complete your request. Hope this helps and may God bless you abundantly.
IF(
(custom_date__c > StartDate && custom_date__c < EndDate),
Do xyz,
otherwise do nothing
)


Best Regards,
Anthony McDougald
SarvaniSarvani
Hi Tony,

If you are trying to build a validation rule to input only date between the start and end dates else throw an error you can use below formula:
 
ISBLANK(Performance_date__c)!=TRUE &&  (IF( (Performance_date__c>  startdate__c   &&  Performance_date__c < enddate__c  ), False, True))
You can also implement custom formula field update and returns true or false based on the above formula.

The formula worked for me. Hope this helps! Please mark as best if it solves your problem.

Thanks