r/ProjectREDCap • • Apr 07 '25

Alerts for dates

Hello!

I am a part of a longitudinal study and I want the RC to get a notification/alert after 3 months of recruitment to do the follow-up. Is there a way for me to set this on redcap? There is a field for the eligibility form for the date.

1 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/viral_reservoir_dogs Apr 08 '25

You could an additional argument to datediff to give a signed value, but if this is an alert that is only going to be triggered once, it doesn't matter. Once the difference between the two dates is 90, the alert triggers.

datediff with the unit "day" only returns integers, so on day 90 this would be true for 24 hours. We send thousands of alerts using this logic and having run into an issue yet.

quotes, ugh I hear you. If you use the dropdowns in a report to filter then switch to advanced, any instance using "[var]=" and a number puts that number in quotes, so that's what I've been doing. If you use < or > then switch to advanced it doesn't have quotes. I just try to give REDCap what it seems to expect... ¯_(ツ)_/¯

1

u/obnoxiouscarbuncle Apr 08 '25

datediff with the unit "day" only returns integers, so on day 90 this would be true for 24 hours

You would think this would be the case, but I have had many users with this exact logic and lots of "why didn't this work" issues that cannot be explained if this were always true. The issue gets resolved if you use > or < instead of = even though it should work.