Results 1 to 6 of 6
  1. #1
    AudiA4_20T is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    28

    Want to update a column A if column B = column C

    Ok so I have a quick question, here is a hypothetical set of data



    A B C
    X 3 3
    2 4
    X 8 8
    X 7 7
    1 4

    Basically I want column "A" (where the Xs are) to be X only if B=C. I have an update query with column A as the "Field" and the "Update To: X" but I don't know how to properly state the Criteria "IIF B=C"

    Any ideas? TIA

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    UPDATE TableName
    SET FieldA = "X"
    WHERE FieldB = FieldC
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    AudiA4_20T is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    28
    Where do I type that in?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's the SQL of a query. You'd obviously need to change all the names to yours.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    AudiA4_20T is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    28
    Thanks, all set

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 01-13-2012, 09:17 AM
  2. Replies: 1
    Last Post: 12-08-2011, 08:03 AM
  3. Replies: 2
    Last Post: 12-05-2011, 04:53 AM
  4. Replies: 1
    Last Post: 08-18-2011, 08:35 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums