Update query

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.
 
G

Guest

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.


.
 
J

John Spencer (MVP)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top