Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding identical records with empty fields

Status
Not open for further replies.

Cornelius19

Technical User
Mar 9, 2007
26
Hi,

I would expect the following query to show identical records from t1 and t2:

Code:
SELECT t1.f1, t1.f2
FROM t1 INNER JOIN t2 ON (t1.f2 = t2.f2) AND (t1.f1 = t2.f1);


It works fine when none of the fields is empty. However, if both tables contain the same value in f1 but f2 is empty, the query does not show the record.

Do you have any idea how to find identical records with empty fields?

Cornelius
 
SELECT t1.f1, t1.f2
FROM t1 INNER JOIN t2 ON t1.f1 = t2.f1
WHERE Trim(t1.f2 & "") = Trim(t2.f2 & "")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks a lot PHV, this is exactly what I need.

Cornelius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top