Hi, I am trying to calculate the number of visits happening "two hours" prior to a given sas datetime. My data has 60k records for 1 year worth of data. Visit ID Triage_Time 1 Oct 1, 2017 00:38 2 Oct 1, 2017 00:50 3 Oct 1, 2017 01:50 4 Oct 1, 2017 01:52 5 Oct 1, 2017 03:50 I want my output to be count(visit ids) if the earliest triage time is two hours prior to the current triage time So here for the visit 4, the number of visits with triage time 2 hours earlier (earlier than 1:52) will be visit id 1,2,3. (3 visits).
... View more