Can I use "Group By" for a column in the Query Grid?

M

Mel

Can I use "Group By" for a column in the Query Grid?

And, can I do it along with the Aggregrate Sum function?

Here is what I am trying to do...

Column 1 = Total Sold: Sum([QtyShipped])
Column 2 = Group by idProduct

So I get one line per product... with the total sold for that product.

And, I don't want this in report format... I'm exporting it to a
spreadsheet.

Thanks for any help.
 
D

Douglas J. Steele

You can work directly with the SQL:

SELECT idProduct, Sum([QtyShipped])
FROM MyTable
GROUP BY idProduct
ORDER BY idProduct

To do it via the Query Grid, add the two fields (idProduct and QtyShipped),
then change the query to a Totals query. That will add a new row to the
grid, preset to Group By under both fields. Change the Group By to Sum under
the QtyShipped field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top