Results 1 to 4 of 4
  1. #1
    Access2010Newbie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    2

    Compare tables in Microsoft Access and EXCLUDE duplicate fields?

    Hi All,

    I'm new to Access, and I've created a test database to learn with.
    What I created was a student database for a school. It's all been going very well up till now, but I'm stuck and was wondering if anyone here might be able to point out a solution.


    I'd like to compare two tables and EXCLUDE the duplicate records in the result.
    That's all. Simple, right?

    More info:

    I have a "ClientInfo table, containing one student's contact info, and I've linked that to a separate "Transcripts" table, that shows the classes they've completed. They’re linked with the “Student ID Number” field.)


    The info from both those tables show up as two separate tabs in a form I’ve created called “StudentInfo”.

    Then I have a third table called “Classes”, listing all the classes the school would provide.


    I want to compare the classes the student's already completed against the classes offered, and have the result be only the classes that they haven't taken.
    That way, you could tell a student what classes are available to them in the next quarter.

    As I said, compare two tables and EXCLUDE the duplicate records in the result.



    I’ve created a query, and looked through and tried building a bunch of different types of expressions in the expression builder, but I can’t figure out the expression to exclude matching data between the two tables: The one with the Student ID number and the classes they’ve taken (Transcripts), and the “Classes” table, containing a list of all the classes offered.

    I figured I could run a query using the "ClassName" field, which appears in both the "Transcripts" and "Classes" tables. I've been searching online for hours, went to the Microsoft site, looked through a bunch of their help and training videos, but can only find examples to INCLUDE all matching records between two tables, I dunno, maybe I'm phrasing my searches incorrectly?

    I would imagine this is pretty simple stuff, just find any existing class name in the student’s “Transcripts” table, match it against any class name in the “Classes” table, and exclude any data that matches, like I said, seems simple, but I'm stuck.

    I’d greatly appreciate any suggestions.
    If there’s any additional info needed, I’ll be happy to provide it.
    Thanks in advance for any help!


    I cleared out any expressions I'd tried, to clean it up, and took a screenshot of what I have now:


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Did you try the FindUnmatched query in the 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
    Access2010Newbie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    2
    Quote Originally Posted by June7 View Post
    Did you try the FindUnmatched query in the Query Wizard?
    Thanks for your reply, and yes, I did try that. I ran the wizard and pasted the simple "Is Null" argument it created into the Query I had previously created and just got no fields in the result. An empty result.

    See, the "Transcript" table would be all of the classes taken by all of the students, so it would contain all classes, just like the "Classes" table would.

    I think maybe I have to put each student's transcript info into the same table as their personal info. Seems like the simplest way to do this.
    I had wanted to keep their info and transcripts separate, but putting them in the same table seems like the simplest solution. I'll make a copy of the database, so I have both versions to play with, and try that out...if anyone else has any ideas, please feel free to comment!

    Thanks again though for replying!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Would have to know more about your data structure to advise further. If you want to provide your project, attach to post. Make copy, remove confidential data, run Compact & Repair, zip if still large.
    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.

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

Similar Threads

  1. Access compare and sum records in two tables
    By piszczel in forum Queries
    Replies: 8
    Last Post: 05-23-2011, 02:07 AM
  2. Compare two tables
    By Igli in forum Access
    Replies: 2
    Last Post: 07-05-2010, 10:30 AM
  3. How can I split 3 tables in Microsoft access 2003?
    By sibby in forum Database Design
    Replies: 1
    Last Post: 05-15-2010, 04:20 AM
  4. Compare two fields!
    By finditsol in forum Forms
    Replies: 1
    Last Post: 02-11-2010, 01:43 PM
  5. Microsoft Access Lookup tables
    By bitert01 in forum Forms
    Replies: 1
    Last Post: 02-20-2009, 02:55 PM

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