Hello,
I'm looking for the best way to create a query using two tables. One table has patient ID, diagnosis date, and diagnosis. The second table table has patient ID, lab value, admission date and discharge date. I would like to create a new table that shows the patient ID, lab value and diagnosis from the first table but only if the diagnosis date is between the admission and discharge date from the second table. Some patients have multiple admissions so there are duplicates in the patient ID field. What is the best way to query this information?
I'm looking for the best way to create a query using two tables. One table has patient ID, diagnosis date, and diagnosis. The second table table has patient ID, lab value, admission date and discharge date. I would like to create a new table that shows the patient ID, lab value and diagnosis from the first table but only if the diagnosis date is between the admission and discharge date from the second table. Some patients have multiple admissions so there are duplicates in the patient ID field. What is the best way to query this information?