Results 1 to 4 of 4

Thread: Taking 2 tables from a Access DB and Comparing them

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    5

    Taking 2 tables from a Access DB and Comparing them

    Here's what I'm looking to do and I can't figure out how to do it.
    I have 2 tables in an access database. The user will enter a part # that is listed in table one. Many specifications are also listed with the part # in Table one. Then I want it to compare all the specs from the part # in table 1 and select the best matching part in table 2. There are about 30 difference columns of specs listed. Both tables are set up the same way with the same columns and everything. Is there anyway to do what I am asking.. I'm hoping it's clear.

    Thank you,
    Corey

  2. #2
    Member
    Join Date
    Aug 2001
    Location
    Eugene, Oregon
    Posts
    41
    What kind of comparison are you wanting to do? See if a column from one table is the same as a column from the other table? Or look for similar values? Or ??

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    5
    Yeah I want to see if the column in one is equal to the one in the other and then display the item with the most column matches.

  4. #4
    Member
    Join Date
    Aug 2001
    Location
    Eugene, Oregon
    Posts
    41
    That could get a little tricky. Here is something I thought of that may work.

    You would need to get the values from the first table/column that the user is accessing into variables. Then do a query like

    Select * from table2 where column1 LIKE '*" & variable1 & "*' OR column2 LIKE '*" & variable2 & "*' ......

    Have a long string like that. It will return all the recordsets that have at least one match. Then, you could loop through the recordset to see how many matches each one has and show the user the one with the most.

    Will that work for you?

Posting Permissions

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



Click Here to Expand Forum to Full Width