Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update with a join statement error 1

Status
Not open for further replies.

cyoung

Programmer
Oct 31, 2001
188
US
I am trying to update a table when there are matching items in another table

Table A - inventory
itemnum
balance

Table B - inventory_transactions
itemnum
qty
invoicenum

What I am trying to do, is to add the inventory qty back into the inventory table when an invoice gets cancelled or changed

Here is my SQL statement

UPDATE inventory SET
inventory.balance = inventory.balance + inventory_transactions.qty
INNER JOIN inventory_transactions
ON inventory.itemnum = inventory_transactions.itemnum
WHERE inventory.itemnum = inventory_transactions.itemnum
AND inventory_transactions.invoicenum = '1'

I am getting an error in the syntax near the INNER JOIN
 
thanks for the info.... guess I really do need to update to 4 now
 
Thanks again for pointing me in the right direction. Upgraded and all is well!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top