I have a table that holds Inpatient Data.
I need to determine if a patient has made re-occurring visits to the hospital in a 30 day period.
I have Patient ID, ServiceFromDate (SFD), ServiceToDate (STD), and DX.
A TRIP is considered if the patient returns to the hospital within 30 days of his/her last discharge date (STD).
Scenario:
Record 1 -Visit 1:
SFD STD
1/1/06 1/5/06
Record 2 - Visit 2:
SFD STD
2/10/06 2/15/06
I need to compare the STD of Record 1 to SFD of Record 2. If the total number of days between the two is 30 or less then return that record.
In the above scenario, this record WOULDN



