Results 1 to 3 of 3
  1. #1
    rich is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2009
    Location
    St. John's, Newfoundland
    Posts
    14

    Including information from multiple tables

    Apologies if the answer to this is somewhere on the forum... I have no idea what to use in my search criteria for this one!



    I'm trying to create a query that takes information from UPTO three tables. The problem is, that its only including results where records exist in all three tables and I need it to include records even if they only have entries in two of the tables.

    The tables are linked by a common piece of information - a membership number. The problem is, that all members don't appear in all three tables. They do always appear in two of the tables, and that remains consistent (ie, they're all in the same two tables), but the third table contains optional information, so there isn't always an entry in the third table for every record in the first two tables.

    I can't figure out how to get it to list all records from table 1 (and table 2), regardless of whether an entry exists for it in table 3.

  2. #2
    rich is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2009
    Location
    St. John's, Newfoundland
    Posts
    14
    Okay, so maybe its something about joins...

    This is an extract from the SQL for the query as it is now -

    FROM tbl_results INNER JOIN (tbl_applicant LEFT JOIN tbl_audition ON tbl_applicant.ID = tbl_audition.ID) ON tbl_results.ID = tbl_applicant.ID

    So you can see the three relevant tables

    tbl_audition - Always a unique record
    tbl_applicant - maybe used several times - applicants may have one or more audition records.
    tbl_results - May or may not exist for any applicant record. Each applicant will have zero or one results record.

  3. #3
    rich is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2009
    Location
    St. John's, Newfoundland
    Posts
    14
    Ah, fixed it by changing the FROM line to

    FROM tbl_audition INNER JOIN (tbl_applicant LEFT JOIN tbl_results ON tbl_applicant.ID = tbl_results.ID) ON tbl_audition.ID = tbl_applicant.ID

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

Similar Threads

  1. Replies: 10
    Last Post: 07-12-2011, 11:09 PM
  2. Replies: 4
    Last Post: 06-14-2011, 07:19 PM
  3. Corrupted owner information in Tables
    By PJneedshelp in forum Access
    Replies: 11
    Last Post: 02-21-2010, 06:36 AM
  4. Updating information in the tables
    By jamilian in forum Database Design
    Replies: 1
    Last Post: 02-17-2010, 08:46 AM
  5. Replies: 1
    Last Post: 07-06-2007, 08:27 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