Results 1 to 3 of 3
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question InStrRev returning unexpected results

    I have the below code and for some reason I'm getting varTableName = "CTL" as the result instead of varTableName = "CTL-DEC6TH".



    Code:
    varFileName = "CTL-DEC6th.txt"
    varTableName = Left(varFileName, Len(varFileName) - InStrRev(varFileName, "."))

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Used Replace(varFileName, ".txt", "") instead.

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    you can use:
    Left(varFileName, InStrRev(varFileName, ".") -1)

    InStrRev returns the position counting from left, not from right.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Query showing unexpected results
    By johnmerlino in forum Queries
    Replies: 30
    Last Post: 10-25-2010, 07:08 AM
  3. Returning multiple records Isn't what I need
    By frobro390 in forum Queries
    Replies: 6
    Last Post: 09-21-2010, 06:24 PM
  4. Query Bug? Not returning consistent results
    By trb5016 in forum Queries
    Replies: 4
    Last Post: 06-15-2010, 12:00 PM
  5. Query not returning all of the results
    By velvettiger in forum Queries
    Replies: 4
    Last Post: 03-11-2010, 06:56 AM

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