+ Reply to Thread
Results 1 to 5 of 5

Partial string match with file name

  1. #1
    Registered User
    Join Date
    04-02-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    96

    Partial string match with file name

    Hey Guys

    I have this code:

    Please Login or Register  to view this content.
    This matches the string with the whole file name, but what I want is a partial match so, for example, if the user enters "123" and the file name is "123 abc" then it will see that file as a match and open it. Does anybody know how this is done?

    Thanks in advance.

    Jamer

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Partial string match with file name

    Hi Jamer,

    For partial matches, you can use the LIKE operator and wildcards. For example:

    Please Login or Register  to view this content.
    Last edited by abousetta; 04-20-2012 at 06:47 AM. Reason: corrected code
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    04-12-2012
    Location
    MD, England
    MS-Off Ver
    Excel 2003
    Posts
    142

    Re: Partial string match with file name

    Hi Jamer

    Apologies abousetta I was unable to get 'LIKE' to work for me so as an alternative....

    Please Login or Register  to view this content.
    hth

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Partial string match with file name

    Sorry about that. I forgot the second wildcard after the str. You can try it now as I have modified hte code above.

  5. #5
    Registered User
    Join Date
    04-02-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    96

    Re: Partial string match with file name

    Works a treat.

    Thank you very much!

    Jamer

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1