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
Year to Date subquery 7
update 0
Update Query from table 4
Query via VBA 0
adding freight amount to total 14
percentage calculation...trying again 25

Top