Comparing two columns with similar values

EDDY20XX

New member
Local time
Today, 02:27
Joined
Apr 17, 2012
Messages
7
Hi,

I have little experience with queries and databases and was looking for some help.

I have two tables. both tables have two column records.(1 column: Product line 2 column: Manufacture) All i care is about the Manufacture column.

I.E.

First table
1Column
GENERAL ELECTRIC
TURTLE WAX
MYERS
LOCTITE

Second Table
1Column
HENKEL CORPORATION (LOCTITE), 000005986
MARVEL OIL-TURTLE WAX INC., 00008999
GE LIGHTING, 000056569

i want to bring back all the values from the First table that have a match to the Second table.

Results
1Column 1Column
GENERAL ELECTRIC GE LIGHTING, 000056569
TURTLE WAX MARVEL OIL-TURTLE WAX INC., 00008999


thank you for any tips or advice.:banghead::banghead:
 
there doesn't seem to be a common field to join the two tables on based upon the information you have provided. Am I missing something or did you forget to tell us the whole story? ie. How do you equate GE Lighting to General Electric? How do you do the same for the Turtle Wax entries. I know we can see it as shown, but how will a machine know when you are running lots of entries to match up?

Alan
 
IT wont i was looking to use a wild card query to bring me back the value that is the closets to the Second table values.
 
I don't see how. You need to have a common field to join the two tables. Without it you end up with a cartesian event that will, depending on the size of each table, could create millions of meaningless records. You may have to rebuild your tables to allow for a common field.


Perhaps one of the more experienced players in this forum has a solution.

Alan
 
Could you not use something along the lines of;
Code:
SELECT FirstTable.Column1, SecondTable.Column1
FROM SecondTable, FirstTable
WHERE (((SecondTable.Column1) Like "*" & [FirstTable].[Column1] & "*"));
 
Data like GE LIGHTING and GENERAL ELECTRIC is going to cause you no end of pain. The whole structure, but this in particular, speaks of the need for a properly normalised table structure.
 
Thanks i will try that query, I was thinking of using *, or [], or or wild cards. I have to play around with it. Thank you for the help.
 

Users who are viewing this thread

Back
Top Bottom