Results 1 to 5 of 5
  1. #1
    AndyDandy is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2018
    Posts
    7

    Filtering unique records based on a grouping

    I am trying to define a query to show only certain records based. Here is my best analogy to describe what I am attempting:


    A school where all students must take an english class. They may also take a variety of other classes. I am attempting to filter out only those students who are taking no other classes but english.

    I'd like to be able to do this within the user interface so that I can describe the logic and show others if a change is necessary.

    Anyone with ideas how best to proceed? I cannot manipulate the tables (read only). There are three tables related in this query. Is a query the best way to achieve this? I use Excel extensively to manipulate table-derived data so this is a process I will likely be doing again.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    why use an analogy? why not real terms?

    yes you will need to use a query and you will need a left join between two of the tables, but without knowing your data structure, can't be any more specific than that.

    On the assumption the 3 tables are student, classes and a link table and English is a given but included in the link table do the following

    There are a number of ways, but essentially you need to create a first query on the link table using criteria to exclude the English class, you only need to bring through the studentID field

    then create another query linking students to the first query on student id. double click on the link to expose properties and change to option 2 (include all students). Then add a criteria for the new query studentID as is null

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Agree with ajax - analogies usually make it harder to give correct advice

    Another way of ding this would be to have a query of the English classes for all students & another with a count of classes attended by all students filtered for count>1
    Join the 2 queries
    If you want those only attending English, modify the filter to count=1

    Both methods work - take your pick
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    AndyDandy is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2018
    Posts
    7
    In real terms, these are facilities being inspected . Every area of deficiency is a "TAG". There can be multiple inspections for facilities (depending on the severity of the deficiency). The three tables are Facility, Survey, Tags.
    Facility1ID SurveyID Tag

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    OK - so either suggestion provided should work

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

Similar Threads

  1. Grouping based on three columns - Snaking
    By AnneForumer in forum Queries
    Replies: 14
    Last Post: 10-07-2016, 01:43 PM
  2. grouping based on dob
    By msnarayanan in forum Forms
    Replies: 3
    Last Post: 09-24-2015, 12:06 PM
  3. Replies: 9
    Last Post: 04-26-2014, 07:10 PM
  4. Replies: 8
    Last Post: 02-07-2013, 09:01 PM
  5. Replies: 15
    Last Post: 04-17-2012, 01:42 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