Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    5

    Unanswered: operation must use an updateable query

    I've created the following query in access 2003:

    Code:
    UPDATE threads AS t1 SET t1.viewed = 1+(select viewed from threads as t2 where t2.id = @id)
    WHERE t1.id=@id;
    for this query I get the title error all the time although the following query forl just fine:

    Code:
    UPDATE threads SET viewed = 20
    WHERE id=@id;
    someone now whats wrong?

    Thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    UPDATE threads t1
    INNER JOIN
    (Select (viewed+1) As VAL
    from threads
    where id = [param]) V ON
    1=1
    SET t1.viewed = V.VAL
    Last edited by r123456; 07-03-04 at 06:59.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    update threads 
       set viewed = viewed+1
     where id = @id
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jun 2004
    Posts
    5
    the best solutions are the simplest ones...
    Thanks alot!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •