Hey all,
I have a query I have proof-tested on a smaller database that either 1) won’t work or 2) is taking an incredible amount of time to run on the real (larger) database.
I have two tables, one Master Table with ~1.5 million records (names, addresses, etc.) and one Names Table with ~1,500 records (just names).
I want to know if a name from the Names Table matches a name in the Master Table, and vice-versa. If there’s a match, I want all of the information for that record in the Master Table to show up (name, address, etc.).
The names likely won’t be exact. E.g. in the Master Table it might be listed as GRIFFEY KEN JR but in the Names Table it might be GRIFFEY KEN (missing the JR). Also, due to how the names are stored in the Master Table, there may be miscellaneous characters in front of the name, e.g. #121 GRIFFEY KEN JR %C/O.
I have a query set up to perform this task. Due to the large # of records, I created a smaller test database and ran it, and it worked perfectly. However, when I run it on my actual database, it takes forever to run. I stop it after ~45 minutes, so I don’t know if it will actually finish.
Is there a way to speed this up? Access didn’t show a progress bar, so I couldn’t tell if it was working or if it was going to crash.
Thanks!
My query is structured as show below:
Name_Search: IIf(InStr([Names_Table]![Full Name],[Master_Table]![MAILTO])>0,[ Master_Table]![MAILTO],IIf(InStr([Master_Table]![MAILTO],[ Names_Table]![Full Name])>0,[ Master_Table]![MAILTO],0))
Criteria
<>0
P.S. When I ran this query in the actual database, it used to give the error message data type mismatch, but I deleted all instances in both tables that weren’t text, so I don’t think this is the issue. I also ensured the field in each table format was set to TEXT. There are some records in the Master Table that begin with numbers, not sure if this has anything to do with it?