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
amish.jainamish.jain 

Comparing Custom Date Fields

I am using this formula

 

(TODAY() - Date_Mktg_Lead__c) - IF((LastActivityDate - Date_Mktg_Lead__c)> (Action_Taken_Date__c - Date_Mktg_Lead__c), (LastActivityDate - Date_Mktg_Lead__c), (Action_Taken_Date__c - Date_Mktg_Lead__c))

 

This Includes three date fields 

 

Date_Mktg_Lead__c

LastActivityDate

Action_Taken_Date__c 


This is working well if all the date fields are filled but if one of the field is blank it dosn't work. Please suggest....

Best Answer chosen by Admin (Salesforce Developers) 
alok29novalok29nov

Hi Amish,

 

Try ISblank function for blank fields.

 

A example for this which i have used in my org:

 

If( ISBLANK(SLX_Create_Date__c), DateValue(CreatedDate), SLX_Create_Date__c)

 

The above formula returns CreatedDateif SLX_Create_Date__c is blank ...i.e. ISBLANK(SLX_Create_Date__c) evaluates to true, else SLX_Create_Date__c.

 

Try to incorporate above function in your logic. Hope this helps...

 

Thanks

~Alok

 

 

 

 

All Answers

Steve :-/Steve :-/

What are you using for "Treat blank fields as..."?  are they blanks or zeros?  Try using 0

amish.jainamish.jain

@Steve Thanks for your response...I tried both "0" and Blank but it is not returning any value if even one of the date field is blank. Guess for date fields "Date - 0" wont work...

alok29novalok29nov

Hi Amish,

 

Try ISblank function for blank fields.

 

A example for this which i have used in my org:

 

If( ISBLANK(SLX_Create_Date__c), DateValue(CreatedDate), SLX_Create_Date__c)

 

The above formula returns CreatedDateif SLX_Create_Date__c is blank ...i.e. ISBLANK(SLX_Create_Date__c) evaluates to true, else SLX_Create_Date__c.

 

Try to incorporate above function in your logic. Hope this helps...

 

Thanks

~Alok

 

 

 

 

This was selected as the best answer