Re: Updating the first row which is null



you can use the TOP predicate in a query (and presumably in a subquery,
though i've never tried it), if you also include an ORDER BY clause. the
records have to be in a specified order, so that Access can figure out which
record is the TOP 1.

hth


<recif20002002@xxxxxxxx> wrote in message
news:1144508902.675910.60370@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello

I am trying to update table1 and set a new value with a condition
selecting only the results for the element with the specified ID and
the first one with the Date field null.
The query executes but it doesn t not update the informations. I ve
tried using TOP 1 and spent hours on this query but i can t get it to
work.

UPDATE table1 SET table1.Name = newName
WHERE table1.Date = (SELECT First(table1.Date) FROM table1 WHERE
table1.Date = Null And table1.ID = specifiedID);;

thank you for your help

Updating the first row which is null



.



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: "Query must use updateable query" error message
    ... You won't be able to write this in Access SQL syntax. ... UPDATE table1 ... Trying to run the update query results in the "Query must use updateable ... INNER JOIN ((SELECT DISTINCT OrderNr, ...
    (microsoft.public.access.queries)
  • 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: Updating the first row which is null
    ... In your query, your WHERE clause is limiting your results to ... I am trying to update table1 and set a new value with a condition ... The query executes but it doesn t not update the informations. ... UPDATE table1 SET table1.Name = newName ...
    (comp.databases.ms-access)