Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106

    Unanswered: update to max value of a few columns.

    Hi,
    I have a table that looks like this:

    ID, F1, F2, F3, maxval

    I am trying to write an update query to update the maxval field with the max value in F1, F2, F3 for each line.

    Something like this:
    Update table, set maxval = max(f1,f2,f3);

    Is this possible in MS Access 2007?

    Thanks
    Mo

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yeah, it's possible, but it's a very poor solution

    why are F1, F2, F3 all on one row? why isn't the table normalized?

    then you wouldn't have to ask how to set a max column, you'd just grab it from the table with a GROUP BY query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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