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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining data

Status
Not open for further replies.

Corgano

Technical User
Oct 7, 2003
82
US
Good afternoon,

I'm writing a query that needs to pull the same data with three different filters due to the way in which it is measured.

For example: I need to pull service times associated with three different codes, call them 1, 2 and 3.

I can pull the times for 1 and 3 with no problem.

2 however needs to be pulled in two different ways as the data gets recorded funny. Each code has three times associated with it (time of problem, time problem acknowledge and time problem resolved.

About 50% of the time the problem for 2 is resolved right away (one record) and sometimes it takes two trips (two records) but when this happens the first of the two records only has two of the three times.

I can write three subquerys, each with a filter designed to capture only one of the three possible situations detailed above... how can I get the 'service time' from all three subquerys to be added together so it doesn't have to be done manually? Or is there another way to pull the data I might be missing?

Any help or suggestions would be greatly appreciated!
 
Sorry, Just wanted to add that each of the subquerys are grouped on Employee name and are returning:

Employee Name
Count of Transactions
Total Service Time (a calculation)


Each subquery is doing what is should be (as checked vs. a data dump) I just want to avoid the 'drop into excel and work with the data further' if it can be avoided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top