Forum Discussion

gmpdba's avatar
gmpdba
Frequent Visitor
10 years ago

replace a null date with a date in the same record

Hey all -

 

I don't if this is simple or not.  I am trying to calculate days between the two dates in the same record.  Some dates in the first column are null and DATEDIFF does not like this.  I would like to replace the second date with the first if the first is null.  

 

If somebody could give me some direction, that would be awesome.

 

Thanks,

Mike 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Something like this?

     

    Days = IF(ISBLANK([Date]),DATEDIFF([EndDate],[EndDate],DAY),DATEDIFF([Date],[EndDate],DAY))
    • gmpdba's avatar
      gmpdba
      Frequent Visitor

      Thank you - I have got to tinker with formula but will get back with this post next week.