By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,466 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Compare to Fields

P: n/a
I have two tables that both contain a part number field. I have been
asked to find a way to show if the two fields match (easy enough) but
also need to find those that closely match. I have been told that if
the first 9 characters match that it would be a sufficient enough
match. I think using the Lens function would work but I am unsure.
any help is appreciated.

KO

May 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
turtle wrote:
I have two tables that both contain a part number field. I have been
asked to find a way to show if the two fields match (easy enough) but
also need to find those that closely match. I have been told that if
the first 9 characters match that it would be a sufficient enough
match. I think using the Lens function would work but I am unsure.
any help is appreciated.


Use the Left() function:

SELECT ...
FROM table1 As T1 inner join table2 as T2
WHERE Left(T1.PartNbr,9) = Left(T2.PartNbr,9)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
May 2 '06 #2

ADezii
Expert 5K+
P: 8,638
I have two tables that both contain a part number field. I have been
asked to find a way to show if the two fields match (easy enough) but
also need to find those that closely match. I have been told that if
the first 9 characters match that it would be a sufficient enough
match. I think using the Lens function would work but I am unsure.
any help is appreciated.

KO
'Try the Like Operator
If Left$([Field1], 9) = Left$([Field2],9) Then
'You have a close match - not necessarilty an 'Exact" match
End If
May 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.