Hi Folks,
The initial SQL (below) sums $ purchases by customer then by Item code.
SELECT customers.custID, items.itemcode,
( Sum (items.pricequote * items.quantity ) ) As gt
FROM customers, orders, items
WHERE customers.custID = orders.custID
AND orders.orderID = items.orderID
GROUP BY customers.custID, items.itemcode
ORDER BY customers.custID, items.itemcode, 3
Gets.........
ITEM CODE CID $ AMOUNT
MPL1632 101 430563
MR3280 101 60564
MSL3280 101 302610
MSL3290 101 430200
MP1608x 102 6048
MP2032 102 13640
MPL1632 102 165062
Order is CID, ITEM CODE. But I need to present the data order by dollar amount. (Big $ numbers first).
Thanks for any help to fix the SQL.
Milt.
The initial SQL (below) sums $ purchases by customer then by Item code.
SELECT customers.custID, items.itemcode,
( Sum (items.pricequote * items.quantity ) ) As gt
FROM customers, orders, items
WHERE customers.custID = orders.custID
AND orders.orderID = items.orderID
GROUP BY customers.custID, items.itemcode
ORDER BY customers.custID, items.itemcode, 3
Gets.........
ITEM CODE CID $ AMOUNT
MPL1632 101 430563
MR3280 101 60564
MSL3280 101 302610
MSL3290 101 430200
MP1608x 102 6048
MP2032 102 13640
MPL1632 102 165062
Order is CID, ITEM CODE. But I need to present the data order by dollar amount. (Big $ numbers first).
Thanks for any help to fix the SQL.
Milt.