Re: "Query must use updateable query" error message

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You won't be able to write this in Access SQL syntax. Your can try:

UPDATE table1
SET CurrentPrice = DMax("Price","Table2","OrderNr=" & OrderNr);

This will be slow but should work (assuming OrderNr is numeric).

--
Duane Hookom
MS Access MVP

"Marc De Schrijver" <marc.deschryver1@xxxxxxxxxx> wrote in message
news:ezoMg.66289$3B5.1128558@xxxxxxxxxxxxxxxxxxxxxxxx
I have a complex query that serves as a basis for joining to a table whose
fields need to be updated with values from fields in the complex query.
Trying to run the update query results in the "Query must use updateable
query" message.

The basic outline of my query is as follows:

UPDATE Table1
INNER JOIN ((SELECT DISTINCT OrderNr, Max(Price) AS MaxPrice FROM Table2
GROUP BY OrderNr) AS TempTable)
ON Table1.OrderNr = TempTable.OrderNr
SET Table1.CurrentPrice = TempTable.MaxPrice

In reality the subquery to which I am inner joining is far more
complicated,
but this simplified version also results in a read-only subquery that
serves
as a basis for joining to the table that is to be updated.

How can this be done? I assume it just needs to be written differently.
Any
help would be greatly appreciated!!

-- Hans De Schryver




.



Relevant Pages

  • Re: Lookup in Query
    ... UPDATE table1 ... I thought the "SET" line in my first query would ... "Tom Ellison" wrote: ... FROM table1, table2 ...
    (microsoft.public.access.queries)
  • Re: Duplicating record and double table check
    ... I don't understand whatthe purpose of the query is, ... Since the new data (CustomerNr and OrderNr) are inputted manually, ... OrderNr is not a duplicate. ...
    (microsoft.public.access.gettingstarted)
  • Update statement using multiple tables
    ... I have a question, hopefully an easy one, about updating values in a ... I would like to have a query ... I thought that if i put table2 in the update clause (update table1, ...
    (comp.databases.informix)
  • Re: Update table with SQL
    ... How about using the DCount function? ... aggregate queries in an update query. ... UPDATE TABLE1 ... I have a SQL query that works fine on an SQL server database but not on ...
    (microsoft.public.access.queries)
  • Re: [Info-Ingres] What happens to unused common table expressions?
    ... If I write a query with one or more common table expressions to which I ... INGRES TERMINAL MONITOR Copyright 2011 Ingres Corporation ... with smallorders (ordernr) as ...
    (comp.databases.ingres)