Hi
I have been asked to provide the time between cases (Turn Around)in a report and I'm stuck, I have no idea where to begin with the SQL query.
We have a single table in an Oracle 8 database that holds patient records including the start and end of each operation and session identifiers (Theatre, Date & Session ID).
What I need to do is show how much time is being wasted between cases. The data is held in the format
Theatre Date SessionId PatientId Start Finish
Th1 1/3/2009 TH1AM P332233 8:30 9:00
Th1 1/3/2009 TH1AM P123223 9:15 10:00
Th1 1/3/2009 TH1AM P339888 10:30 11:30
Th1 1/3/2009 TH1AM P339999 11:35 11:50
Th2 1/3/2009 TH2AM P776666 8:40 10:00
Th2 1/3/2009 TH2AM P887772 11:30 12:00
what I want to do is produce a report in the following format
Theatre Date SessionId
Th1 1/3/2009 TH1AM
PatientId Start Finish Turn Around
P332233 8:30 9:00
P123223 9:15 10:00 0:15
P339888 10:30 11:30 0:30
P339999 11:35 11:50 0:05
Theatre Date SessionId
Th2 1/3/2009 TH2AM
PatientId Start Finish Turn Around
P776666 8:40 10:00
P887772 11:30 12:00 1:30
Any help gratefully appreciated
Thanks
I have been asked to provide the time between cases (Turn Around)in a report and I'm stuck, I have no idea where to begin with the SQL query.
We have a single table in an Oracle 8 database that holds patient records including the start and end of each operation and session identifiers (Theatre, Date & Session ID).
What I need to do is show how much time is being wasted between cases. The data is held in the format
Theatre Date SessionId PatientId Start Finish
Th1 1/3/2009 TH1AM P332233 8:30 9:00
Th1 1/3/2009 TH1AM P123223 9:15 10:00
Th1 1/3/2009 TH1AM P339888 10:30 11:30
Th1 1/3/2009 TH1AM P339999 11:35 11:50
Th2 1/3/2009 TH2AM P776666 8:40 10:00
Th2 1/3/2009 TH2AM P887772 11:30 12:00
what I want to do is produce a report in the following format
Theatre Date SessionId
Th1 1/3/2009 TH1AM
PatientId Start Finish Turn Around
P332233 8:30 9:00
P123223 9:15 10:00 0:15
P339888 10:30 11:30 0:30
P339999 11:35 11:50 0:05
Theatre Date SessionId
Th2 1/3/2009 TH2AM
PatientId Start Finish Turn Around
P776666 8:40 10:00
P887772 11:30 12:00 1:30
Any help gratefully appreciated
Thanks