Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    Atlanta
    Posts
    10

    Question Unanswered: Can't query if multiple related tables are added.

    I'm trying to do a query that would allow a user to type a SSN and it will display information for the person from different tables. If I just use the main table, works fine. If I add the related tables, which at the moment don't have that much information, it comes back blank.

    It's as if it views the fields from the other table as an AND. I may totally be doing the query wrong, so that's why I'm here.

    My goal is to do a report from the query so I have all my fields on the query. For some reason, I have a feeling this may not be good practice. I played around with just having enough fields to query and adding the additional fields on the report but that didn't seem to work.

    Thanks in advance for any help.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Take a look at "OUTER JOIN" vs. "INNER JOIN"

  3. #3
    Join Date
    Mar 2004
    Location
    Atlanta
    Posts
    10
    I'm closer!

    What happens when the related table doesn't have any entries that corresponds to my SSN? It's currently not returning any data.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    That would be the INNER vs. OUTER thing.

    an INNER join is only going to return records where the value matches in BOTH tables, OUTER will return records regardless of whether or not they match.

  5. #5
    Join Date
    Mar 2004
    Location
    Atlanta
    Posts
    10
    Gotcha! I'll spend time on that. Appreciate the information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •