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

    Left instr help

    I have a table with 500 rows and the name field is like this:



    Dr. Zvi Ben-Zvi
    Dr. Zova Liu

    I know how to get just the last name with a mid query, but trying to do a left and all I end up with is Dr. portion. This is the code I am using but it is not right because I want the first name as:

    Dr. Zvi
    Dr. Zova

    Code:
    Left([pcp],(InStr(1,[pcp]," "))-1)

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,399
    try

    left(pcp,instrrev(pcp," ")-1)

  3. #3
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169
    That's the ticket. Thanks

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

Similar Threads

  1. Replies: 4
    Last Post: 04-22-2015, 05:46 PM
  2. IIF with instr
    By yoili in forum Reports
    Replies: 2
    Last Post: 01-22-2013, 01:32 PM
  3. Using InStr() inside Mid()
    By urbi in forum Programming
    Replies: 12
    Last Post: 06-06-2012, 12:00 PM
  4. Replies: 3
    Last Post: 02-02-2011, 01:00 PM
  5. INSTR(), quick little syntax ?
    By markjkubicki in forum Forms
    Replies: 2
    Last Post: 11-15-2010, 02:46 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