Totals

deanaldo

New member
Local time
Today, 13:24
Joined
Aug 6, 2009
Messages
6
Hi, I want to create a query that shows all repairs done by an engineer and how many tubes were installed by an engineer for each job over a specified date. I want to display every job the engineer has done and then at the end of their jobs I want a total of how many tubes they have installed.

Here is what I have right now:

RepairedBy StartDate InstalledTubes
1 12/12/08 15
1 12/3/09 0
1 1/7/09 12.4
1 14/7/09 25
2 29/11/08 23
2 11/9/08 0
2 4/5/09 4.7
3 8/7/08 5
3 12/10/08 0
3 3/12/08 32.4

What I want to have is:

RepairedBy StartDate InstalledTubes
1 12/12/08 15
1 12/3/09 0
1 1/7/09 12.4
1 14/7/09 25
Total Tubes Installed: 52.4
2 29/11/08 23
2 11/9/08 0
2 4/5/09 4.7
Total Tubes Installed: 27.7
3 8/7/08 5
3 12/10/08 0
3 3/12/08 32.4
Total Tubes Installed: 37.4

Is this possible to do in a query or would I be better off doing this in the report I'm going to create from the query?

Here is the SQL used:

SELECT Tbl_Jobs.RepairedBy, Tbl_Jobs.StartDate, Tbl_Jobs.InstalledTubes
FROM Tbl_Jobs
GROUP BY Tbl_Jobs.RepairedBy, Tbl_Jobs.StartDate, Tbl_Jobs.InstalledTubes
HAVING (((Tbl_Jobs.StartDate) Between [Please Enter Start Date] And [End Date]));
 
You need a group by employee sum tubes where dates between x and y query
 

Users who are viewing this thread

Back
Top Bottom