Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]Turn Around Time[/b]

Status
Not open for further replies.

ibib3

IS-IT--Management
Feb 14, 2002
14
0
0
GB
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 a 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 in the table 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, with the last column showing the amount of time between the cases (Turn Around Time)


Th1 1/3/2009 TH1AM P332233 8:30 9:00
Th1 1/3/2009 TH1AM P123223 9:15 10:00 0:15
Th1 1/3/2009 TH1AM P339888 10:30 11:30 0:30
Th1 1/3/2009 TH1AM P339999 11:35 11:50 0:05

Th2 1/3/2009 TH2AM P776666 8:40 10:00
Th2 1/3/2009 TH2AM P887772 11:30 12:00 1:30

Any help gratefully appreciated

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top