Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with completed sql call
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Help with completed sql call
Miscellaneous
Thread ID:
00616796
Message ID:
00616796
Views:
55
I'm trying to create a query (possibly a stored procedure) that returns the following items by procedure

Procedure
# of procedures performed
Avg Time of the procedure
Avg Resource Cost

example results would be
procid  procdesc    # done     Avg Time (Minutes)    Avg Cost
---------------------------------------------------------------
 51.23  LAP CHOLE     12         90                   723.12
 51.25  LAP HYST       5         75                   653.00

Tables Include:
1) Meetings - has the time ProcedureStart,ProcedureEnd (Datetimes)
2) MeetProc - has the procid & description linked to meetings on meetingnumber
3) coCaseData - has the inventoryID, Qty, ItemUnitCost linked to meetings on meetingnumber
Factors:

- there is 1 meeting record per case
- there maybe more than 1 meetproc record for each meeting record, if there is more than 1, it will be a different procedure

- there maybe more than 1 coCaseData record for each meeting record


Thanks
Kirk
Next
Reply
Map
View

Click here to load this message in the networking platform