Update Query

E

Edgar Thoemmes

I am trying to updates some costs in my database. I have the following
tables:

tblCopies(CopyId, BookID[fk to tblbookdetails], Condition,Price)
tblBookDetail(BoodId, ISBN, Author)
tblBook/AuthortblPrices(ISBN, Quantity, UnitPrice)
tblPrices(ISBN, Quantity, UnitPrice)

I am trying to update the price in tblcopies with the price in tblPrices.
The query must edit the same number of records in tblCopies as is in the
quantity field in tblPrices. For example I may have 100 copies of BookID 152
but I only want to update 5 of them which is in the Quantity field in
tblprices

My SQL so far:

UPDATE Table1 INNER JOIN (tblBookDetails INNER JOIN tblCopies ON
tblBookDetails.BookID = tblCopies.BookID) ON Table1.ISBN =
tblBookDetails.ISBN SET tblCopies.TotalCost = [Table1]![UnitPrice];
 
E

Edgar Thoemmes

Sorry SQL should read:

UPDATE Table1 INNER JOIN (tblBookDetails INNER JOIN tblCopies ON
tblBookDetails.BookID = tblCopies.BookID) ON Table1.ISBN =
tblBookDetails.ISBN SET tblCopies.TotalCost = [tblPrices]![UnitPrice];
 

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

Similar Threads

Repost Update Values 1
Complex Append Query 1
Update Query from table 4
VBA to Query. 2
NOT criteria in query not working 5
trouble with query results 1
Problem with Update query 6
Update Sum Query 2

Top