Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    2

    Unanswered: Like keyword with field name

    Im trying to compare two different fields in two tables and return the results if they are similar. The field im going off is a street address, but in one table the address might have a rd, and the other might be dr, stuff like that.

    What i want to do is compare the street number with the name of the street and return the record if they match.

    I was thinking the Like keyword may work but i cant figure it out. Anyone else ever try something like this?

    Thanks in advance

  2. #2
    Join Date
    Jul 2003
    Posts
    16
    If you're storing the addresses in each table in a single field, you'll have problems getting the similars. Regardless you may want to try creating a Union query to combine the data from both tables. This is where the trouble starts. If you have the address number in its own field, you could easily run a Duplicate query based on the Union query to find the similars. If you store the addresses in a single field, you may want to try the Left function. In reality you could use the Left Function in the Union query as a search field, that would elimate the number of queries you'd have to write.

    Hopefully that doesn't leave you more confused, but there wasn't much info about your database in your question.

  3. #3
    Join Date
    Nov 2007
    Posts
    2
    yeah unfortunately the data we were provided with has the address in one field, which is why i made another table based on the first 10 characters of the address and trying to find the match up.

    For the record though, incase anyone else runs into the problem, it was a syntax issue. I used
    "where tbl1.address like tbl2.address & "*" "

Posting Permissions

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