Results 1 to 8 of 8
  1. #1
    DSam is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2016
    Posts
    6

    Inverted Left function - how to exclude string with variable length


    How can I exclude/remove the first 8 digits in a string that doesn't have a fixed length? To separate the first 8 digits into a new field is no problem by using the Left function. But how do I clear the first 8 and keep the rest of the string.. Cannot use the Right function...

  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,518
    Check out the Mid() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Right(strname,(len(strname)-8)

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by aytee111 View Post
    Right(strname,(len(strname)-8)
    Untested, but I'd think a single function would be more efficient than 2.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You're right!

  6. #6
    DSam is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2016
    Posts
    6
    Hi
    Tested Right(strname,(len(strname)-8) and it works!!
    Thanks!

  7. #7
    DSam is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2016
    Posts
    6
    ... Didn't work.. Got a error message after saving the query. Mid function is of course the solution which I should have known. Thanks pbaldy!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    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: 3
    Last Post: 06-08-2014, 05:36 PM
  2. Replies: 6
    Last Post: 01-21-2014, 06:39 PM
  3. Trouble with string variable in custom vba function
    By CurrentUser in forum Programming
    Replies: 4
    Last Post: 01-10-2014, 09:13 PM
  4. Replies: 3
    Last Post: 05-28-2013, 12:53 PM
  5. Replies: 3
    Last Post: 11-02-2012, 04:19 PM

Tags for this Thread

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