Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Atlanta
    Posts
    568
    Thanks
    7
    Thanked 1 Time in 1 Post

    Update Query With 4 Values (97)

    I have a field named Difficulty that can have one of four values, a, b, c, or d. I want to write an update query to change these values so that:

    a=Easy
    b=Moderate
    c=Hard
    d=Very Hard

    I can change one value at a time using an update query but I cannot get the query to update all four. I tried putting in four columns with the same Difficulty field and using a criteria but that did not work. Can this be done?

    Ronny
    Ronny Richardson

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Update Query With 4 Values (97)

    Why not create a new table, and call it tblDifficulty. It should contain 2 fields: Difficulty and Description. Then join it to your existing table. This way, you won't have to change anything in the old table.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Atlanta
    Posts
    568
    Thanks
    7
    Thanked 1 Time in 1 Post

    Re: Update Query With 4 Values (97)

    I actually want to change the value in the old table. It's data that I've imported from another source and I need to get it in the same shape as the rest of the data.

    Ronny
    Ronny Richardson

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Update Query With 4 Values (97)

    Mark's suggestion will work with a query. Simply create the 4 entries in the new table and include both tables in an update query and join the single character fields. Then update the old table with the value contained in the new table description.
    Wendell

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Update Query With 4 Values (97)

    Well then, I suppose you could use the Switch command in the "Update to" field, like this: Switch( fieldname="a","easy",fieldname="b","Moderate, etc.....).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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