briangriffin
Programmer
I have a group of patients participating in a special program. I need to compute the number of hospital visits for each patient before and after they joined this program.
Patient table looks like this:
Need to populate the Patient table with a PreActiveVisits total of 3 but I'm not sure how to approach this without using a cursor.
Patient table looks like this:
Code:
PatientID ActiveDate InactiveDate PreActiveVisits
111 7/1/2016 12/31/2016 ?
Visits table looks like this:
PatientID AdmitDate
111 1/1/2016
111 2/1/2016
111 3/1/2016
111 8/1/2016
Need to populate the Patient table with a PreActiveVisits total of 3 but I'm not sure how to approach this without using a cursor.