Complicated query....

pdbowling

Registered User.
Local time
Today, 08:05
Joined
Feb 14, 2003
Messages
179
Hi, all. I can't seem to iron out this query..

Here are the important table elements.

Key DeptGroup truckCount
IA702 Facilities 5
IP000 Plant 1 2
IP001 Plant 1 2
etc....

What I'm needing to do is

Wherever DeptGroup is the same, return a table with the truckCount added together.... like this


DeptGroup truckCount
Facilities 5
Plant 1 4


Any suggestions????

This is what I tried

Select distinct(deptGroup), sum(truckCount) from table;
but that isn't correct....

Thank you all, You have been so helpful.
PB
 
Us a Totals Query
Include Dept and TruckCount then simply Group by Sum of TruckCount
 
select DeptGroup, sum(truckCount)
from table
group by DeptGroup;
 

Users who are viewing this thread

Back
Top Bottom