I have an interesting, but nasty problem on my hands.
When going over a design of a db, I found that in the Relation Diagram, a relation was not in place.
The relation is between tPerson.PersonID and tEmployee.FKPersonID.
The moment that I wanted to link the two, the db indicated that it was not possible (see capture).
This means that the missing relation needs to be found, to solve this issue.
What I normally do is to copy the tables in question into Calc, and try to find the missing relation, by aligning the related records, and subtract them. When the result is '0', the relation exists.
It is a method that works for a couple of hundred records, but the db in question is more than 8,000 entries.
Is there a quicker way to find a missing relation?
Dream
UPDATE:
Found a simple solution:
Code: Select all
SELECT *
FROM tEmployee
WHERE NOT FKPersonID IN (
SELECT PersonID
FROM tPerson
);