Group by & Sum

T

tryn2learn

Good afternoon,

I’m trying to sum and group data in a query.

Right now my query looks like this (example below) multiple PERL entries

Account JobType Volume Count Average Page Total Postage
PERL Bill 12345 1.69 134.55 22845 193 325
PERL Bill 78963 96.1 554.31 54822 391 523
PERL Letters 67890 4.54 98.25 26475 257 446
PERL Fin State 123435 7.39 61.95 30105 321 567
PERL PostC 178980 10.24 25.65 33735 385 688
PERL NCO 234525 13.09 10.65 37365 449 809
PERL CAN 290070 15.94 46.95 40995 513 930
PERL Mec 345615 18.79 83.25 44625 577 1051
PERL Fld Ply 401160 21.64 119.55 48255 641 1172
PERL Flt Ply 456705 24.49 155.85 51885 705 1293
PERL Cut 512250 27.34 192.15 34185 769 1414

I need it to look like this but for all job types when more than one entry
appears:

Account JobType Volume Count Average Page Total Postage
PERL Bill 91308 97.79 688.86 77667 584 848
PERL Letters 67890 4.54 98.25 26475 257 446
PERL Fin State 123435 7.39 61.95 30105 321 567
PERL PostC 178980 10.24 25.65 33735 385 688
PERL NCO 234525 13.09 10.65 37365 449 809
PERL CAN 290070 15.94 46.95 40995 513 930
PERL Mec 345615 18.79 83.25 44625 577 1051
PERL Fld Ply 401160 21.64 119.55 48255 641 1172
PERL Flt Ply 456705 24.49 155.85 51885 705 1293
PERL Cut 512250 27.34 192.15 34185 769 1414
 
D

Duane Hookom

How far have you gotten? Have you clicked the sigma button (backwards 3) in
the query design tool bar?
 
K

KARL DEWEY

Try this --
SELECT [Account], [JobType], Sum([Volume]) AS Expr3, Sum([Count]) AS Expr4,
Sum([Average]) AS Expr5, Sum([Page]) AS Expr6, Sum([Total]) AS Expr7,
Sum([Postage]) AS Expr8
FROM YourTable
GROUP BY [Account], [JobType];
 
Top