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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding records in a lookup that ARE NOT reference in a main table

Status
Not open for further replies.

AWEinCA

Programmer
Oct 18, 2000
35
0
0
US
I am have a difficult time trying to write this SQL statement.
Would someone give me a hand with it?

I have three tables linked linearly:
Borrowers
CodeCompletions
Codes (Lookup Table)

A Borrower has to complete all of the codes in the Codes table.
As the codes are being completed a record is entered in the CodeCompletions table.

What I need are the codes that the borrower has NOT yet completed.

Borrowers linked to CodeCompletions via "SSN"
CodeCompletions linked to Codes via "ProcessingCodes"

This seems pretty standard. Would someone help me put this information in a form? I tried using a subform but it doesn't work. The value to link the forms on is NULL in the Codes table.

Any help would be appreciated!
Aaron


 
I'm not clear on your database design, but I believe the answer will involve using a subquery.

Create a query that returns all the codes that have been answered. Copy the SQL syntax of the query.

Your final SQL will read something like this:

Select Whatever
From Whereever
Where Code not in (YourCopiedSQLCodeHere);

Does that make sense?

Kathryn


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top