Query Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've built a database to track volunteers and their assignments on a project.
I'm trying to build a query to select records from a "volunteers" table who
don't have an entry in the "ShiftAssignment" table. I tried to use an
"IsNull" criteria, but it didn't work because they don't have record in the
"ShiftAssignment" table to check for a null criteria. What is the correct
way to select those records from the database?
 
I've built a database to track volunteers and their assignments on a project.
I'm trying to build a query to select records from a "volunteers" table who
don't have an entry in the "ShiftAssignment" table. I tried to use an
"IsNull" criteria, but it didn't work because they don't have record in the
"ShiftAssignment" table to check for a null criteria. What is the correct
way to select those records from the database?

You can use the Unmatched Query Wizard, or you can "roll your own" as
follows:

Create a new Query. Join [Volunteers] to [ShiftAssignment] (or to a
query based on ShiftAssignment for a certain project or certain date
range, if you want to find volunteers who have been assigned in the
past but just not for this particular project).

Select the Join line and choose Option 2 (or maybe 3) - "Show all
records in Volunteers and matching records in ShiftAssignment".

Select whatever fields you want to see from Volunteers, and *only* the
linking field (VolunteerID?) from ShiftAssignment.

Put a criterion on this field of

IS NULL

This "frustrated outer join" query will find only those volunteers who
are NOT in the table (or query).

John W. Vinson[MVP]
 
Works like a champ. I never would have perceived that approach from my
manual or the help section. Thanks.
 

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

Similar Threads

Programming a result field in a table 5
Access Dcount (multiple criteria) 3
Query Parameter using multiple options 0
Parsing a table 1
Stored date is not being recognised 1
Is Null 2
query query 3
iif exists - too complex? 1

Back
Top