I am trying to update a master inventory table from an order details table, the query below works fine except when the order details table contains the same code number multiple times. When this occurs the update only updates for the first instance of the code number.
How do I make the update work for all the records not just the unique records?
UPDATE Inventory.Inven tory
SET Qty = Inventory.Inven tory.Qty - Retail.OrderDet ails.Qty FROM Inventory.Inven tory INNER JOIN
Retail.OrderDet ails ON Inventory.Inven tory.Code = Retail.OrderDet ails.Code
WHERE (Retail.OrderDe tails.Invoice = 207070202)
Thanks
How do I make the update work for all the records not just the unique records?
UPDATE Inventory.Inven tory
SET Qty = Inventory.Inven tory.Qty - Retail.OrderDet ails.Qty FROM Inventory.Inven tory INNER JOIN
Retail.OrderDet ails ON Inventory.Inven tory.Code = Retail.OrderDet ails.Code
WHERE (Retail.OrderDe tails.Invoice = 207070202)
Thanks
Comment