I have two Tables ("Shortages", "Orders"). Shortages contains each Material once, Orders is all the Material orders. I am trying to update Shortages field CurrentWeek with the sum of all orders of a material from Orders.
I am not an SQL guru and this is stumping me. I have googled things but I can't seem to get anything to work.
I can write a select query that gets me what I want with all the WHERE clauses but I can't get the values into the other table.
Any help is greatly appreciated!
SELECT Orders.Material, Sum(Orders.Quantity) AS SumOfQuantity FROM Orders WHERE (((Orders.Plant)="N.Amer") AND ((Left([Orders].[Order_Number],4))<>"NA01") AND ((Year([Ship_Date])*53+DatePart("ww",[Ship_Date]))=Year(Date())*53+DatePart("ww",Date()))) GROUP BY Orders.Material;That is the select query I have that gives me what I want and groups it...I am trying to pass that grouped sums to the Shortages table...Material is the link between both tables. I will try a few more and see what I can post.