Joined: 14 Feb 2013
Online Status: Offline
Posts: 6
Topic: date 30 days before another date Posted: 10 Sep 2014 at 4:58am
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"
Joined: 14 Feb 2013
Online Status: Offline
Posts: 6
Posted: 10 Sep 2014 at 5:55am
It was completely random of when it was right and not. I did get a solution from someone on another site's board and it works perfectly....in case anyone ever needs it:
I needed to ensure the testdate is before the procedure date:
if ({TEST.DATE}) >= DateAdd('d',-30, {PROCEDURE.DATE}) AND {TEST.DATE} <= {PROCEDURE.DATE} then "Yes" ELSE "No"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum