Results 1 to 2 of 2
  1. #1
    guygodwin is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2012
    Posts
    1

    Simple Update Query

    This is what I have and it is not working. I am not sure what the correct syntax should be.



    Table name = SkpiUpdate
    Field = NAMC

    I have several records that have "04" listed. I would like to updated these 04 fields with the accronym "TMMMS".

    My current not good code:
    UPDATE SkpiUpdate SET SkpiUpdate.NAMC = if(NAMC='04',TMMMS,NAMC);

    Any help on the proper Syntax would be great.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It would need to be:

    UPDATE SkpiUpdate SET SkpiUpdate.NAMC = iif(NAMC='04',"TMMMS",NAMC)

    But more efficient would be:

    UPDATE SkpiUpdate SET SkpiUpdate.NAMC = "TMMMS"
    WHERE NAMC='04'
    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. Simple Update SQL
    By DADAZHU in forum Programming
    Replies: 4
    Last Post: 12-08-2011, 05:22 PM
  2. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  3. need help with this simple query
    By dada in forum Programming
    Replies: 3
    Last Post: 08-20-2010, 07:08 AM
  4. simple query
    By taylorosso in forum Queries
    Replies: 1
    Last Post: 10-06-2009, 04:26 AM
  5. Need Help with a very simple query
    By bikerguy06 in forum Queries
    Replies: 3
    Last Post: 06-08-2009, 08:43 PM

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