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!

Find Unmatched Query problem

Status
Not open for further replies.
Mar 29, 2002
23
US
I have two tables that have a composite primary key. Dept and Name are individual fields, but combined they create a unique row in my tables.

I'm trying to run a Find Unmatched Query on those two tables and was wondering why I can't select both fields when the wizard asks "What piece of information is in both tables?" (Where you have to set field A in Table 1 = Field A in Table 2).

Anyone know a way to do this?
 
I haven't used that Wizard for a while but seem to recall that you could not use two columns to match tables. You can select one column, allow the wizard to generate the query and then edit the query to add the other column to the join criteria.

Alternately you can open a new query in SQL View. Type the following, substituting the correct table and column names.

Select a.*
From tableA a
Left Join tableB b
on a.Dept=b.Dept
and a.name=b.name
Where b.Dept Is Null Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top