Hi,
I'm having trouble with an update query, I'm trying to update, an inventory table with records from an invoice table. I have the query below that updates the inventory quantity field and it works fine. The problem I have is when the invoice table has multiple items with the same code number the query doesn't update the total number it only updates for one record. How can I correct this problem?
UPDATE Inventory.Inventory
SET WQty = Inventory.Inventory.WQty + Wholesale.OrderDetails.Ship
FROM Wholesale.OrderDetails left outer JOIN
Inventory.Inventory ON Wholesale.OrderDetails.Code = Inventory.Inventory.Code
WHERE (Wholesale.OrderDetails.Invoice = @invoice)
Thanks
Perrin
I'm having trouble with an update query, I'm trying to update, an inventory table with records from an invoice table. I have the query below that updates the inventory quantity field and it works fine. The problem I have is when the invoice table has multiple items with the same code number the query doesn't update the total number it only updates for one record. How can I correct this problem?
UPDATE Inventory.Inventory
SET WQty = Inventory.Inventory.WQty + Wholesale.OrderDetails.Ship
FROM Wholesale.OrderDetails left outer JOIN
Inventory.Inventory ON Wholesale.OrderDetails.Code = Inventory.Inventory.Code
WHERE (Wholesale.OrderDetails.Invoice = @invoice)
Thanks
Perrin