Hello I need help with an update query
I got 2 ms Access tables.
-Table_A
Fields:
ID - FatherID - Price - Quantity
-Table_B
Fields:
ID - Price
I have to update Table_B.Price With the sum of Table_A.Price GROUP BY Table_A.FatherID , With the condition that Table_A.FatherID = Table_B.ID.
The query must be something like (I know that isn't correct):
UPDATE Table_B AS t2
INNER JOIN Table_A AS t1 ON (t1.FatherID = t2.ID)
SET t2.Price = (SELECT SUM (Round(((t1.Price * t1.Quantity)),2)) FROM Table_A AS t1 GROUP BY t1.FatherID )
Thank you
I got 2 ms Access tables.
-Table_A
Fields:
ID - FatherID - Price - Quantity
-Table_B
Fields:
ID - Price
I have to update Table_B.Price With the sum of Table_A.Price GROUP BY Table_A.FatherID , With the condition that Table_A.FatherID = Table_B.ID.
The query must be something like (I know that isn't correct):
UPDATE Table_B AS t2
INNER JOIN Table_A AS t1 ON (t1.FatherID = t2.ID)
SET t2.Price = (SELECT SUM (Round(((t1.Price * t1.Quantity)),2)) FROM Table_A AS t1 GROUP BY t1.FatherID )
Thank you