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

  • Thread starter Thread starter Mel
  • Start date Start date
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.
 
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.
 
Back
Top