Results 1 to 8 of 8
  1. #1
    Access_newbie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    5

    Compare Data in Multiple Tables

    I am having a difficult time comparing data in mulitple tables in Access. The following shows how I have the data set up

    Table A: Student Info
    Student Name
    Address



    Table B: Courses Taken
    Student Name
    Course Taken
    Completion Date

    Table C: Courses Available
    Course
    Frequency

    I need a query to return Which students have not taken specific courses. The tables are related. How do I join the tables in a query to produce the results I need?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If this is the actual structure of your tables you're in trouble. Every table should have a primary key. A primary key is a field that can not possibly be duplicated under any circumstances. The way you have it set up if 2 people have the same name you're going to get duplicate results and erroneous reporting. Is this the actual structure of your tables or are you leaving out information?

  3. #3
    Access_newbie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    5
    I have the following keys set up.
    Table A: Student Info
    Student Name (Primary Key)
    Address

    Table B: Courses Taken
    ID (Primary Key)
    Student Name (Foreign Key)
    Course Taken (Foreign Key)
    Completion Date

    Table C: Courses Available
    Course (Primary Key)
    Frequency

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    The student Name as a primary key really needs to be changed to some other field, (an autonumber field would work fine)

    if COURSE is a text field like 'english' or 'math' I would also replace that with a autonumber ID field. that way you can change descriptions of your courses without losing any links to other tables.

    Once that's done the question is this: are each one of your students required to take each class in your courses? That's what you're basically asking for in your original request. So if you have 500 courses you will want a line in your query for each class the student did not take of those 500, is that really what you want?

  5. #5
    Access_newbie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    5
    Yes. I have about 20 courses that are mandatory. I need to figure out which students have not taken a required course.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Here's an example

  7. #7
    Access_newbie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    5
    Thanks! I will try it real quick.

  8. #8
    Access_newbie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    5
    It worked!!! Thanks sooo much!!!!

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

Similar Threads

  1. Replies: 7
    Last Post: 01-29-2014, 02:45 PM
  2. Access compare and sum records in two tables
    By piszczel in forum Queries
    Replies: 8
    Last Post: 05-23-2011, 02:07 AM
  3. Compare records in 2 tables
    By RalphJ in forum Access
    Replies: 13
    Last Post: 03-06-2011, 07:43 AM
  4. Compare tables and tell me differences
    By cowboy in forum Programming
    Replies: 2
    Last Post: 08-11-2010, 08:32 AM
  5. Compare two tables
    By Igli in forum Access
    Replies: 2
    Last Post: 07-05-2010, 10:30 AM

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