I am trying to look at patients with a test date within 30 days before their procedure date. So if the test was 20 days before the procedure, they count as Yes. But if the test was 31 days (or more) before the procedure date, they don't count (No). What I am using is calculating correctly sometimes, but not all the time and I don't understand it.
if ({TEST.DATE}) > DateAdd('d',-30, {PROCEDURE.DATE})
then "Yes"
ELSE "No"
if ({TEST.DATE}) > DateAdd('d',-30, {PROCEDURE.DATE})
then "Yes"
ELSE "No"