Update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to update "TA" Qty by adding Qty from RS. The
SQL below is not working.

UPDATE [TA], [RS] SET [TA].Qty = DSum("[TA]![Qty]+[RS]!
[Qty]","RS","[Item Code] = " & [Item #])
WHERE ((([TA].[Item #])=[RS]![Item Code]));

Thank you for your help.
 
HUH!!!
-----Original Message-----
try this revision:
HTH
I am trying to update "TA" Qty by adding Qty from RS. The
SQL below is not working.

UPDATE [TA], [RS] SET [TA].Qty = [TA].Qty + DSum("[RS]!
[Qty]","RS","[Item
Code] = " & [Item #])
WHERE ((([TA].[Item #])=[RS]![Item Code]));

Thank you for your help.


.
 
Probably, something along the lines of the following would work.

UPDATE [TA]
SET TA.Qty = TA.Qty +
NZ(DSum("Qty","RS","[Item Code]=" & Chr(34) & [Item #] & Chr(34)),0)

If Item Code (or Item #) are not text, but a number field then drop the Chr(34)
from the criterion.
 
Back
Top