Results 1 to 7 of 7
  1. #1
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139

    Compare Two Tables / Return a List of What is Missing

    I think I have this just about done. Thank you! I have one new function I'd like to create in my grade book. I have tables and queries which show student's completion of course assignments , a percentage of the course complete. What I would like to do now is a query that will compare the list of course assignments (table: assignments) to the students grades (table: Grades) which show which assignments have been completed for each course and their score for each assignment. What I would like to see, is a list of assignments which have to been completed, assignments for which there is no grade. Some of the assignments can be accomplished out of order, so I need to see what is and isn't done. I'm attaching a zip file of the database in case you need to see what I'm working with.



    Thank you,
    Michael
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    If you want to know what is not yet accomplished then you a dataset of all possible combinations of students/assignments. This dataset can be generated with a Cartesian type query, like:

    SELECT Assignments.ID AS AssignID, Students.ID AS StuID FROM Assignments, Students;

    Without a JOIN clause, every record of each table will associate with each record of other table resulting in all possible combinations.

    Compare that dataset with Grades dataset. Build FindUnmatched query with compound join on both ID fields.
    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
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139
    Thank you! I got the unmatched query to bring up courses and assignments the way I expected but I can't seem to get the students name associated with the missing assignments.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Post the attempted queries.

    Did you first build Cartesian query I suggested?
    You can include student name fields in that query.
    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.

  5. #5
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139
    Yes, I did create it and it includes StudentID and works fine but when I compare that dataset with Grades, if any student did a particular assignment, it makes it appear as if everyone did.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Finally got around to downloading db. Opening immediately errors on:
    Code:
    Private Sub Form_Load()
       DoCmd.GoToRecord , , acNewRec
    End Sub
    

    Use Open event instead. Or use the form DataEntry property set to Yes.

    Why don't you save Assignment ID in Grades instead of the descriptive text?

    SELECT Query1.Students.ID, Query1.FirstName, Query1.LastName, Grades.Grade, Query1.Assignments.ID, Query1.Assignments
    FROM Grades RIGHT JOIN Query1 ON (Grades.Assignment = Query1.Assignments) AND (Grades.[StudentID] = Query1.[Students].[ID])
    WHERE (((Grades.Grade) Is Null));

    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.

  7. #7
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139
    Ah, yes! This finally worked. I had to tweak a few things but my database is now everything I wanted it to be. (for now) I think that my biggest problems all along have been the test for assignments instead of ID in Grades. Thank you!

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

Similar Threads

  1. Replies: 7
    Last Post: 03-05-2019, 07:50 AM
  2. Replies: 3
    Last Post: 12-21-2015, 06:55 PM
  3. Replies: 3
    Last Post: 07-30-2015, 03:59 AM
  4. Replies: 2
    Last Post: 06-03-2011, 04:36 PM
  5. Replies: 0
    Last Post: 08-01-2009, 12:43 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