I need to write an update statement that updates POExtendedTotal grouped by the PONumber with the sum of ItemExtendedCost
I believe I am on the write track as my select statement is returning the right results, but the update statement does not recognize the alias SumOfItemExtendedCost
UPDATE FulfilmentOrders
SET FulfilmentOrders.POExtendedTotal = SumOfItemExtendedCost
From FulfilMentOrders
Where FulfilmentOrders.POnumber IN (SELECT FulfilmentOrders.PONumber, Sum(FulfilmentOrders.ItemExtendedCost) AS sumOfItemExtendedCost
FROM FulfilmentOrders
GROUP BY FulfilmentOrders.PONumber, FulfilmentOrders.Disti_ID, FulfilmentOrders.OrderSent
HAVING FulfilmentOrders.Disti_ID=13 AND FulfilmentOrders.OrderSent=0)
Thoughts?
I believe I am on the write track as my select statement is returning the right results, but the update statement does not recognize the alias SumOfItemExtendedCost
UPDATE FulfilmentOrders
SET FulfilmentOrders.POExtendedTotal = SumOfItemExtendedCost
From FulfilMentOrders
Where FulfilmentOrders.POnumber IN (SELECT FulfilmentOrders.PONumber, Sum(FulfilmentOrders.ItemExtendedCost) AS sumOfItemExtendedCost
FROM FulfilmentOrders
GROUP BY FulfilmentOrders.PONumber, FulfilmentOrders.Disti_ID, FulfilmentOrders.OrderSent
HAVING FulfilmentOrders.Disti_ID=13 AND FulfilmentOrders.OrderSent=0)
Thoughts?