Calculating time between dates.
Posted on 2006-06-30
We are trying to write an Access or SQL query that finds patients who were re-admitted to the hospital within 30 days of their last discharge date, and we are struggling BIG TIME!! The table would be something like shown below. Somehow, we need to have our query evaluate the patient's discharge date and compare that to their next admit date, then determine if the difference between the two dates is less than 30 days, and if so, return that Visit.
Visit # Name ADmit Date D/C Date
1 DOE, JOHN 01/01/2006 01/05/2006
2 DOE, JOHN 01/30/2006 02/08/2006
3 DOE, JOHN 05/30/2006 06/09/2006