georgia51390
Programmer
This is a tough one! I have a table of patient enrollment data. The table has a patient ID, an enrollment date, and a status value. Patients are in the table for every month that they are enrolled, and the date is always the last day of the month. I need to write a statement to look at each enrollment date, then look BACKWARDS 11 months from that date and verify that the patient had 11 status values. For example: For Patient A, if they have an enrollement date of 12/31/99, I need to look at 11/30/99, 10/31/99, 9/30/99, ..... all the way back to 1/31/99. I need to verify that for each of those dates starting with 12/31/99 and going backwards, that Patient A had a valid status value. If that patient had 11 valid status values from 1/31/99 - 12/31/99, then I want to pull that record with the 12/31/99 enrollment date.
Any suggestions?? This one has me stumped. Thanks so much!
Any suggestions?? This one has me stumped. Thanks so much!