I don't know why this one is giving me such trouble - I've written much more complex queries. Table OITM has ItemCode and Vendor - 1 line per item. Table OITW has ItemCode, WarehouseCode, BOH (balance on hand) and MTD_Sales - 1 line per item per WH. For Vendor XYZ, I'm trying to get a list of ItemCodes with total BOH and total MTD_Sales for all
(
Read more... )
Comments 2
SELECT ItemCode, SUM(BOH), SUM(MTD_Sales)
FROM OITM, OITW
WHERE OITM.ItemCode = OITW.ItemCode
AND Vendor = 'XYZ'
GROUP BY ItemCode
*hope I didn't embarrass myself with some obvious mistake*
Reply
Reply
Leave a comment