Forum Discussion

Mo-PHAT's avatar
Mo-PHAT
Helper I
9 years ago
Solved

DateDiff with IF statement

Hi,   I have 2 columns of dates and wish to get the days between these dates. Easy done with a datediff.   However sometimes the to date will be 31/12/2099 as these are dates in a job so that mea...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Mo-PHAT

     

    Try this

     

    DaysAtPos = IF ([Date to].[date] = 12/31/2099, DATEDIFF ([Date from].[Date] , TODAY(), DAY) ,

                                                                                DATEDIFF([Date from].[Date],[Date to].[Date],DAY) )

     

    If this works foryou please accept this as solution and also give KUDOS.

     

    Cheers

     

    CheenuSing