Affichage des articles dont le libellé est Help with an update query. Afficher tous les articles
Affichage des articles dont le libellé est Help with an update query. Afficher tous les articles

Help with an update query

mercredi 4 mars 2015

Ok so I'm not really sure how to do what I want to do, I'm not sure what to google to find out how to do it.



I want to update values in one table using values in another table. The table I want to be updated has a stock value for each product, I have a query that pulls the records from the most recent order from a composite key table.



The records I want to use to update the StockNumber values have a ProductID that corresponds to the ProductIDs in the table to be updated as well as a Quantity value that needs to be taken away from the StockNumber




Code:



UPDATE [tblqryInvoice-Product]

INNER JOIN Products ON ([tblqryInvoice-Product].ProductName = Products.ProductID) AND ([tblqryInvoice-Product].Quantity = Products.StockNumber)

SET Products.StockNumber =[StockNumber]-[Quantity];



This update sql bit that I managed to gleam from a tutorial website and somewhat adapt produces the message "you are about to update 0 records" when I run the query

Help with an update query

Labels