I will try to describe briefly this challenge:
A doctor (MD) can be hired at one or more of four facilities, A,B,C & D, during any month between 2006 and the present. Thus the table MD contains the doctor ID field (MD) and four Date fields. When the doctor is hired by a facility, he must go to Employee Health one time. If he gets hired by as many as four facilities, he still only has to go to Employee Health the first time.
Employee Health wants to know how many visits they had in each month over this period, and of course never count the same doctor twice.
I have queried for the "exclusives" for a facility in a month (hire date B in range, and nulls in A, C & D), and queried the non-exclusives (hire date B in month range, but some (any) other date for that MD in either A, C or D.
Perhaps this is more of a mathematical puzzle, but I would sure like to solve it cleanly, such that my weighted totals for each facility for each month add up to the total number of new hires (a known quantity!).
Thank you!
Tom
A doctor (MD) can be hired at one or more of four facilities, A,B,C & D, during any month between 2006 and the present. Thus the table MD contains the doctor ID field (MD) and four Date fields. When the doctor is hired by a facility, he must go to Employee Health one time. If he gets hired by as many as four facilities, he still only has to go to Employee Health the first time.
Employee Health wants to know how many visits they had in each month over this period, and of course never count the same doctor twice.
I have queried for the "exclusives" for a facility in a month (hire date B in range, and nulls in A, C & D), and queried the non-exclusives (hire date B in month range, but some (any) other date for that MD in either A, C or D.
Perhaps this is more of a mathematical puzzle, but I would sure like to solve it cleanly, such that my weighted totals for each facility for each month add up to the total number of new hires (a known quantity!).
Thank you!
Tom