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
Cynthia Rodgers 12Cynthia Rodgers 12 

Checkbox Formula field that is evaluating two date field is not updating as expected

I have created a custom checkbox field that is checking to see if two date fields are the same.  If they are the same then i want the checkbox to update to true.  This is not happening.  The formula(s) i am using are :

LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c

IF(LLC_BI__Account__r.Exception_Pricing_Effective_Date__c = Created_Date_1__c,TRUE,FALSE)

I created a new record to test the functionality and these two dates (exceptiong pricing effect date and the created date) are the same, however the checkbox is unchecked.  When i set the operator to not equal then the field updates to true.  
Best Answer chosen by Cynthia Rodgers 12
Cynthia Rodgers 12Cynthia Rodgers 12
I ended up doing a calcuation on the number of days between the dates but when the date is the same its counting it as 1.  So I modified the formula to this and it seems to be working now as expected.  Not sure if its the correct path but the result is what im looking for.

Formula: Created_Date_1__c - Exception_Pricing_Eff_Date__c < 1

All Answers

Raj VakatiRaj Vakati
try this
 
IF(LLC_BI__Account__r.Exception_Pricing_Effective_Date__c == Created_Date_1__c,TRUE,FALSE)

 
Cynthia Rodgers 12Cynthia Rodgers 12
Thanks Raj,  the field didnt update the checkbox as expected.
Alain CabonAlain Cabon
DATE or DATETIME?

DATEVALUE(LLLC_BI__Account__r.Exception_Pricing_Effective_Date__c) = DATEVALUE(Created_Date_1__c)
Cynthia Rodgers 12Cynthia Rodgers 12
Alain its a Date field.
Cynthia Rodgers 12Cynthia Rodgers 12
I ended up doing a calcuation on the number of days between the dates but when the date is the same its counting it as 1.  So I modified the formula to this and it seems to be working now as expected.  Not sure if its the correct path but the result is what im looking for.

Formula: Created_Date_1__c - Exception_Pricing_Eff_Date__c < 1
This was selected as the best answer