How to find Orphan Records ?

W

Will

If you have a dB which does not have referential integrity on...

And since when linking tables you can't see 'all records in both' (at least
I don't know how to do it)

How can you set up a query or whatever to see Orphan records?

thanks for any help.
 
A

Al Camp

Will,
Create a query between your Parent and Child table related via your key
field, but make the join a "Right-Outer" join.
Which means... "show all in my child table and only those in the parent that
match."
When the query is run, any child key fields that don't show a corresponding
parent key field are orphans.

Of course, you are going to get the standard lecture on proper table design.
Referential Integrity combined with Cascading Updates/Deletes will solve
this problem permanently.
 
A

Allen Browne

Use the Unmatched Query wizard (first dialog when you create a new query) to
select the records in one table that have no match in the other.
 
D

Douglas J Steele

There's a Find Unmatched Query Wizard that you can use. Just follow its
instructions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top