Results 1 to 5 of 5
  1. #1
    SoonerLater is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    3

    Query to find Values that do NOT exist

    I have two tables (Household and Relationships). Both have a field named Household_ID.



    Click image for larger version. 

Name:	Access - 01.png 
Views:	12 
Size:	17.4 KB 
ID:	22084

    How can I structure a query which basically says, "Find all records in the Households table whose Household_ID does NOT appear in the Household_ID field of the Relationships table?"

    The query I've written:

    Click image for larger version. 

Name:	Access - 02.png 
Views:	12 
Size:	4.7 KB 
ID:	22085

    does not work. Obviously I am doing this wrong. How should I re-write this query to produce the desired results?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Look at the Access unmatched query wizard.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It looks about right to me. Double click the JOIN line and make sure you have selected, "Include ALL records from 'Household' and only those records from 'Relationships' where the joined fields are equal."

  4. #4
    SoonerLater is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    3
    Quote Originally Posted by orange View Post
    Look at the Access unmatched query wizard.
    Thank you, that achieved my goal.

  5. #5
    SoonerLater is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    3
    Quote Originally Posted by ItsMe View Post
    It looks about right to me. Double click the JOIN line and make sure you have selected, "Include ALL records from 'Household' and only those records from 'Relationships' where the joined fields are equal."
    Ahhhhh!!!! Light bulb! That's wonderful. Not only did that work, I learned.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-10-2015, 02:24 PM
  2. Replies: 4
    Last Post: 07-10-2015, 07:51 AM
  3. Find difference of values between dates
    By Miquel1 in forum Queries
    Replies: 8
    Last Post: 12-10-2013, 10:37 AM
  4. Replies: 3
    Last Post: 10-02-2011, 06:47 PM
  5. Query: How many times does a value exist?
    By hognabbt in forum Queries
    Replies: 1
    Last Post: 01-10-2010, 01:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums