Re: Error using UPDATE statement



Well I figure out the problem. I had a GROUP BY at the end of the
SELECT subquery.

UPDATE Tbl1
SET Row2 = '1'
WHERE Tbl1.Row1 = (SELECT Tbl2.Row1
FROM Tbl2
WHERE Tbl2.Row1 = Tbl1.Row1
AND CURRENT_TIMESTAMP >= Tbl2.Row3 GROUP BY
Tbl2.Row1)

Thank you again for your help.

.



Relevant Pages

  • Re: Get the latest status
    ... Use a subquery. ... Tips for Access users - http://allenbrowne.com/tips.html ... tbl1: id, start_dt, end_dt ... tbl2, id, status, status_change_dt ...
    (microsoft.public.access.queries)
  • Re: Using Cursors
    ... > UPDATE tbl1 ... > FROM tbl2 ... > Tibor Karaszi, SQL Server MVP ... >> I have a question about how to replace a cursor with a set based operation. ...
    (microsoft.public.sqlserver.programming)