Comparing two excel columns with MS Query

chris2005

New member
Local time
Today, 05:33
Joined
Jun 27, 2009
Messages
2
Hi there,

I would like to compare two excel columns like:

testab testbb
testaa testabbb
testcc testaaff

As you can see testab and testaa (reg)matches two times.

With what sql query using MS Query can I retrieve those matches?

Note that I want to get the matches based on LIKE statements.

Pls help.

Thanx in advance.

Regards,
Chris
 
Welcome!

why not just use VLookups?

Since I understood those are exact matches only or less then or more then statements. I need LIKE statements.
 
VLookups can be frustrating, but they don't need an exact match.

Anyway, for MS Query, you'd use something like this:
Code:
SELECT DISTINCT [T1].[FieldName1],
(SELECT Count([T2].[FieldName2])
 FROM myDataList T2
 WHERE [T2].[FieldName2] Like [T1].[FieldName1] & "*") AS NumberOfMatches
FROM myDataList T1

Not tested, but that would be my approach.

HTH,
John
 
Last edited:

Users who are viewing this thread

Back
Top Bottom