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!

Using queries to detect missing records.

Status
Not open for further replies.

Phooey

Programmer
Feb 14, 2000
111
GB
I have a database in which I am trying to import data from an ODBC source into an Access Table.<br><br>The table which I am importing from has three keys, <font color=red>[Enquiry Number]</font>, <font color=red>[Enquiry Number Suffix]</font> and <font color=red>[Enquiry Line Number]</font>.<br>The table I am importing into has the same three keys, <font color=blue>[Enquiry Number]</font>, <font color=blue>[Enquiry Number Suffix]</font>and <font color=blue>[Enquiry Line Number]</font>.<br>The three keys are needed to build a unique key in both cases.<br><br><br>I have tried using the unmatched query wizard to build a query to find were the ODBC records don't exist in the Access table.&nbsp;&nbsp;The problem is that the Wizard will only join on one field.&nbsp;&nbsp;Any other query I've tried using will only show the records which exist on both the ODBC and Access table.<br><br>Is there an easier way of building a query to find where the records don't exist on both tables, as I'd rather not commit to a massive import each time. (User requirement).<br><br>Any help would be most appreciated.<br><br>Thanks
 
True, the unmatched query wizard will only join one field, but after the query is built by the wizard, you can go into design view and match the other two fields in the same way.&nbsp;&nbsp;You create two more inner joins and use the criteria where the two additional keys are null (use the example of how the first key is joined and referred to).&nbsp;&nbsp;This should do the trick. <p>-Chopper<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks for that.<br><br>I had one working last night which only used one key field.&nbsp;&nbsp;I tried running the same query this morning and nothing was returned.<br><br>I since found out the the join properties needed to be adjusted to retrieve the selected fields for the first table and all fields from the second table.<br><br>Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top