T
Tom Ellison
Dear Olden:
This is your basic aggregate query, also called a totals query.
SELECT SKU, SUM(QTY) AS QTY
FROM YourTable
GROUP BY SKU
Notice that you cannot report the PURCHASE_ORDER, as it is not the same
across all the rows for each SQU. If you did include the PURCHASE_ORDER, it
would give the sum for each SKU/PURCHASE_ORDER combination. Unless you had
the same SKU twice within a PURCHASE_ORDER (which might never happen) it
would not be summing anything, just one row at a time. Perhaps you already
recognized that, as you did not ask for PURCHASE_ORDER in the output you
specified.
There is a good study for this in the online help. You may benefit from
observing this in the query design grid if you're already comfortable with
that feature. Just paste the code I gave into the SQL View of a new query
and save and name the query. Test it, and look at the Design View.
Tom Ellison
This is your basic aggregate query, also called a totals query.
SELECT SKU, SUM(QTY) AS QTY
FROM YourTable
GROUP BY SKU
Notice that you cannot report the PURCHASE_ORDER, as it is not the same
across all the rows for each SQU. If you did include the PURCHASE_ORDER, it
would give the sum for each SKU/PURCHASE_ORDER combination. Unless you had
the same SKU twice within a PURCHASE_ORDER (which might never happen) it
would not be summing anything, just one row at a time. Perhaps you already
recognized that, as you did not ask for PURCHASE_ORDER in the output you
specified.
There is a good study for this in the online help. You may benefit from
observing this in the query design grid if you're already comfortable with
that feature. Just paste the code I gave into the SQL View of a new query
and save and name the query. Test it, and look at the Design View.
Tom Ellison