+ Reply to Thread
Results 1 to 3 of 3

search and match in Access or SQL

  1. #1
    Registered User
    Join Date
    02-26-2009
    Location
    Groningen
    MS-Off Ver
    Excel 2003
    Posts
    4

    search and match in Access or SQL

    Hi,

    I hope that someone can help me with this problem.
    I have attached a workbook showing the issue.

    In the workbook you will see 2 sheets (sheet1 & sheet2)
    What I tried to do was use an INDEX function (in the "path" column, sheet1) to find the phone number from the "TEL" column (sheet1) in the "File Name" column in sheet2.

    As you can see the phone number is present in part of the path name in the "File Name" column in sheet2.

    =INDEX(Sheet2!$B$1:$B$20,MATCH(1,SEARCH("*"&B2&"*",Sheet2!$B$1:$B$20),0))

    This works fine but not if i have to search 45000 rows. Then the search can take hours or maybe days. Not a good thing.

    Does anyone know a way to do this in access or SQL (Ihave uploaded the sheets to Access and SQL db's).

    Please could you tell me how to do this?

    Thanks and Regards,

    Thomas
    Attached Files Attached Files
    Last edited by VBA Noob; 02-27-2009 at 08:19 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Help Needed with search and match in Access or SQL

    This is not answering your specific SQL question but you can use non-array formulae in XL:

    Sheet1!D2:
    =LOOKUP(2,1/ISNUMBER(SEARCH($B2,Sheet2!$B$1:$B$40000)),Sheet2!$B$1:$B$40000)

    This will be quicker...you can also think about using formulae to extract the phone number from the path on Sheet2 and then use INDEX/MATCH on Sheet1 by referencing the Column on Sheet2 that contains the extracted number.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: search and match in Access or SQL

    Related to this thread:

    http://www.excelforum.com/excel-gene...2-vlookup.html

    This will be quicker...you can also think about using formulae to extract the phone number from the path on Sheet2 and then use INDEX/MATCH on Sheet1 by referencing the Column on Sheet2 that contains the extracted number.
    which is what I showed in the referenced thread...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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