Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009

    Unanswered: How to Pick off FileShare String?

    Can anyone suggest how to build a query to pick off a certain portion of a fileshare path. For example we have the following.

    \\Machinename\Sharename\folder1\folder2\folder2\fo lder4\

    Many variations of this will exist throughout the table. What I need to do is pick out all the unique occurances of the variation upto folder 1. Keep in mind the generic names I use here are replaced by may different combinations of names so I essentially need to be able to search and stop on the N slash. In this case the third one with nothing past it.


    Thanks for your sugestions.

  2. #2
    Join Date
    Jul 2009

    Smile Find

    I placed you data in table named table5 then I used this code
    SELECT InStr(1,[Table5]![fileshare_Path],"folder1") AS Count_to_folder1, Left([Table5]![fileshare_Path],[Count_to_folder1]+7) AS Expr1
    FROM Table5;
    If you past the code into SQL View and look at it in design view you will understand it better at least I would. It seemed to work , I put in several combinations and always came up with what I think you are looking for.

  3. #3
    Join Date
    Nov 2007
    Adelaide, South Australia
    I'd create a function to read the string in character by character and keep reading it until the 5th instance of a "\" is encountered.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Jul 2009

    Smile I think you have it right but thats not how I did it

    Actually I created a query and counted the number of character starting after the first two \\ and including the next \ I then removed that part and counted to the fourth and removed that, then counted to the 5th when the numbers are added I used the right function for that count.

Posting Permissions

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