I work for a hopital and I need to see the date difference between admissions. My data is below.
PatientID VisitID AdmitDateTime DischargeDateTime
M551955 E2472054 02/27/2012 7:35AM 02/27/2012 1:47PM
M551955 E2473744 02/29/2012 7:17AM 02/29/2012 2:29PM
M551955 E2477588 03/02/2012 7:32AM 03/02/2012 2:00PM
M551955 E2478997 03/05/2012 7:35AM 03/05/2012 3:34PM
M58040 E2444570 01/19/2012 4:01PM 01/25/2012 8:00PM
M58040 E2463583 02/13/2012 10:00PM 02/18/2012 3:04PM
M58040 E2502936 04/06/2012 10:00AM 04/10/2012 9:32PM
I want to show the date difference beteen the 1st and 2nd date and the 2nd and 3rd, etc. How can I calculate the difference on the previous record? I need the calculation to be diff of AdmitDateTime and DischargeDateTime.
Some Patients have 27 records, some only have 2.