Results 1 to 5 of 5
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    Comma

    I feel like an idiot. I cannot remember how to do an update query on a name without a comma. I have 1 field that is Last First but with no comma and want a comma.

    FAM
    Jones Angela

    I want Jones, Angela

    I forgot how to do this.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    AliasNameHere:Left([FAM],Instr(1, [FAM], " ") -1) & ", " & Mid([FAM], Instr(1, [FAM], " ") + 1)

  3. #3
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    Thanks it is giving me a syntax error though

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    I just tested and it works as a new field (with an alias), but if you are trying to use it as the UPDATE part of an update query then you would need to remove the alias part and just use:

    Left([FAM],Instr(1, [FAM], " ") -1) & ", " & Mid([FAM], Instr(1, [FAM], " ") + 1)

  5. #5
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    Great. It was the alias thing that threw it. It works just as an update. Thanks so very much.

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

Similar Threads

  1. End of Text Box - Replace Comma with Period
    By bburton in forum Programming
    Replies: 14
    Last Post: 06-20-2011, 03:20 PM
  2. Replies: 6
    Last Post: 06-15-2011, 11:48 AM
  3. Parsing A Comma Delimited Field
    By AccessGeek in forum Import/Export Data
    Replies: 6
    Last Post: 02-03-2011, 01:52 PM
  4. Syntax error (comma) in query expression?
    By TheWolfster in forum Queries
    Replies: 5
    Last Post: 05-10-2010, 12:02 PM
  5. Replies: 1
    Last Post: 07-31-2009, 03:57 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