Results 1 to 3 of 3
  1. #1
    jhmiii is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    2

    Searching for records with data in parent table but none in daughter table

    I am building a query for seeking records in a parent table with data in a particular field, but which have no records in a daughter table. I have a Compounds table and a daughter table, Suppliers. After entering a lot of data in both tables I need a query that highlights (and ideally counts) all of the records that have data in [Compounds]![CASNumber], but no data in [Suppliers]![Company]. Both tables are shown in the Query builder and an outer join has been selected: Include All records from 'Compounds' and only those records from 'Suppliers' where the joined fields are equal. Only some of the [Compounds] records have [CASNumber] entered and only some of the those have [Suppliers]![Company] entered. The query I constructed has only three fields: [Compounds]![CompoundNumber], [Compounds]![CASNumber], and [Suppliers]![Supplier]. I am sorting on [Compounds]![CompoundNumber]. I added this criteria to [Compounds]![CASNumber]:
    Code:
    [Compounds]![CASNumber] <> "IsNull"
    . I also added the following criteria to [Suppliers]![Supplier]:
    Code:
    [Suppliers]![Company]="IsNull"
    Switching to Datasheet View shows no records. I am guessing my criteria are somehow incorrect as this is the first time I have tried to use criteria.



    I appreciate any and all suggestions provided.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Post the attempted query SQL statement.

    Try using the Find Unmatched query wizard.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jhmiii is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    2
    Used the Find Unmatched query wizard and added "Is Not Null" as a criterion to the field that needs to be populated in the parent table. Worked like a charm! Thanks for the help Moderator. I made the problem much more difficult than it needed to be!!

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

Similar Threads

  1. Replies: 5
    Last Post: 12-01-2014, 11:31 AM
  2. Replies: 7
    Last Post: 03-20-2014, 06:20 AM
  3. Replies: 3
    Last Post: 10-02-2012, 12:25 PM
  4. Replies: 3
    Last Post: 08-09-2012, 01:49 PM
  5. Replies: 1
    Last Post: 12-28-2010, 11:24 AM

Tags for this Thread

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