Share via

Access 2016 Partial Match

Anonymous
2018-02-20T00:10:13+00:00

I'm trying to query two separate tables for partial matches to the address field.  I have a daily dump of new addresses (located in table new) that I would like to match to existing addresses (table existing).  I'm having no problems matching EXACT matches, but I need to be able to match partial (such as 123 Main St would match 123 Main St as well as 123 Main).  I've tried a Select Query with criteria using Like and Like "*", but I'm still only getting exact matches.  Your help is greatly appreciated!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

11 answers

Sort by: Most helpful
  1. ScottGem 68,830 Reputation points Volunteer Moderator
    2018-02-20T00:56:59+00:00

    The LIKE operator works with wildcards (*,?) to produce partial matches. So

    WHERE ((([Address]![Address]) Like [New]![sha]))

    Will produce only an exact match.

    Try it this way:

    SELECT New.shn, New.sha, New.rca, New.bill

    FROM New, Address

    WHERE ((([Address]![Address]) Like "*" & [New]![sha] & "*"))

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-02-20T01:13:32+00:00

    I truly appreciate your help, but unfortunately switching to the new WHERE statement still did not produce the expected results.  I'm running it through a Query in Access 2016...any other ideas?

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. ScottGem 68,830 Reputation points Volunteer Moderator
    2018-02-20T00:33:26+00:00

    It would help if you posted your SQL statement, Are you trying to join the tables or just filter? A WHERE clause like:

    Address LIKE "*123 Main*"

    should return any records with 123 Main in the address field.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. ScottGem 68,830 Reputation points Volunteer Moderator
    2018-02-20T01:24:51+00:00

    Could you upload the database to cloud storage and a post a link so I could take a look?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2018-02-20T00:47:12+00:00

    I would like to just filter and see exact and partial match.  Here's what I have so far:

    SELECT New.shn, New.sha, New.rca, New.bill

    FROM New, Address

    WHERE ((([Address]![Address]) Like [New]![sha]))

    I've also tried this:

    WHERE ((([Address]![Address]) In ([New]![sha]))

    And I've tried:

    WHERE ((([Address]![Address] & "*") Like [New]![sha]))

    The Address field has been scrubbed to not include things like St (short for street), La (short for Lane), etc...it only includes things like 123 Main which is why I want the field "sha" to be able to match whether it's 123 Main or 123 Main St.

    Was this answer helpful?

    0 comments No comments