datediffcalculated-fieldredcap

Does including ‘today’ in the Datediff function mess up the automated calculation?


Background: I use RedCap to track expiration dates for temporary appointments in my department. The specific issue I am having is with a calculated field I use to track how many days are remaining until ann appointment expires.

The calculated field equation is:

datediff(‘today’,[appt_end_date],’d’,true)

Problem: I have to use the “fix calcs now” function within the data quality application on a daily basis to update the calculation. For every day that I forget to do that, the calculation is off by 1 days. For instance, the below picture reflects what I see after forgetting to check REDcap for 3 days.

Question: is this a system issue or a user issue?

Display of calculated field error

I am unsure what to try. I have searched for similar issues and can’t find much.


Solution

  • One workaround is to create a report and use advanced filter logic with something like this:

    datediff('today',[appt_end_date],'d',true) >= 0 and 
    datediff('today',[appt_end_date],'d',true) < 10
    

    This would return records in which the end date occurs between today and 10 days in the future.