Skip to main content
Hi,

 

I want to create a formula checkbox that can tell if the date that a task was created and a timestamp on the account are the same. I want do this so I can created a report that can show me when the most recent activity associated to an accounts was (whether it was today or a month ago).

 

Both fields are Date/Time fields, but they are not working. I feel like there's something simple that I'm forgetting as this seems like it should be a very simple formula. Are there limitations around using Date/Time fields in formulas? In the examples I'm looking at, the two fields exactly match one another.

 

Here's the formula: 

 

IF(Date_Created__c=Account_Lookup__r.Most_Recent_Activity__c, TRUE, FALSE)

 

issues with date/time formula
6 answers
  1. Feb 19, 2021, 5:22 AM
    Hi Matt, 

     

    Your formula you're looking for should be just:

     

    Date_Created__c = Account_Lookup__r.Most_Recent_Activity__c 

     

    In general, an IF should never return true and false, since the criteria you put in that if would already be a boolean expression that returns one of these values.

     

    Howeverz if this isn't working, then consider that date-time fields are actually represented by milliseconds. You may see only hours and minutes, but behind the scenes the values could be thousands of milliseconds apart. What you'll want to do is create some sort of acceptable time range, for instance:

     

    AND (

     

        Date_Created__c >= Account_Lookup__r.Most_Recent_Activity__c - (0.05/24), 

     

        ​​​​​​Date_Created__c <= Account_Lookup__r.Most_Recent_Activity__c + (0.05/24) 

     

0/9000