Grouping?

  • Thread starter Thread starter Toan Chau
  • Start date Start date
T

Toan Chau

Hi all.

I have a query that looks something like this...

TTC 1 4 4
SMB 2 3 4
TTC 3 3 3
WXE 3 2 2
SMB 4 2 1

How can I make it so that instead of the my query looking
like that it looks like...

TTC 4 7 7
SMB 6 5 5
WXE 3 2 2

Is there a way to combine fields with the same vaule, such
as the "TTC" and sum of the number vaules?

Is this some type of grouping that can be done in a query
or is it done in a report?

A thousand thanks in adavance.

--Toan
 
Is this some type of grouping that can be done in a query

Yes: a Totals query. Create a query based on your table and click the
Greek Sigma icon (looks like a sideways M, or W). You'll get a new row
in the query grid, Totals; by default it will Group BY every field,
but you can also use Sum - which is what you want here it seems -
Count to count records, Avg for averaging, etc. etc.
 
Hi John,

Thanks for the response.
I tried it and it didn't seem to group the "TTC" part. I
set it as...

TTC --> Group by
Data1--> Sum
Data2--> Sum
Data3--> Sum

And I still get multiply instances of "TTC" instead of
being groupped under one "TTC

Help :-)

Thanks again.
 
Hi John,

Thanks for the response.
I tried it and it didn't seem to group the "TTC" part. I
set it as...

TTC --> Group by
Data1--> Sum
Data2--> Sum
Data3--> Sum

And I still get multiply instances of "TTC" instead of
being groupped under one "TTC

Please open the query in design view, and on the leftmost toolbar icon
select "SQL" using the dropdown box. Copy and paste the SQL to a
message here.

I suspect you may have other fields that you're grouping by.
 
I tried again this morning and it worked just like you
said it would.

I guess I did something wrong the first time.

A thousand thanks sir!!!

--Toan
 
Back
Top