Results 1 to 5 of 5
  1. #1
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11

    update query that copies a name

    I need help: I have 3 fields: complete name, first name, and last name. I need to create an update query that takes first name out of complete name field and copies it to the first name field and the same for the last name field. Names in complete name field formated as Last name, First name. Example: Johnson, Steve


    Thank you

  2. #2
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11
    I figured out this function for the first name field: Left([CompleteName],InStr(1,[CompleteName],",")-1)
    Still need help with the last name field.

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    This should do it:
    FirstName: Mid([CompleteName],InStr(1,[CompleteName],",")+2,Len([CompleteName]))

    Note: it doesn't matter so much the length of the string your return, as long as it is at least long enough, and you are starting in the correct spot.

  4. #4
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11
    Ok...Right(Trim([CompleteName]),Len(Trim([CompleteName]))-InStr(1,[CompleteName],","))

  5. #5
    alinapotter is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11
    Thank you, that worked as well.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-13-2013, 10:37 PM
  2. Replies: 1
    Last Post: 03-08-2012, 09:17 AM
  3. labeling multiple copies
    By tgavin in forum Reports
    Replies: 1
    Last Post: 05-11-2011, 05:07 PM
  4. Printing hard copies
    By Sarge, USMC in forum Forms
    Replies: 1
    Last Post: 02-05-2011, 11:46 AM
  5. Replies: 1
    Last Post: 07-31-2010, 11:50 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