Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    China
    Posts
    54

    Unanswered: Query Help: Showing parents with & without child

    I am trying to design a form (and the tables/queries supporting it) that can display all parent records (even if there are no child records) as well as all child records. So...

    Parent table: Company
    Child table: Personnel

    The form should list all companies (as header rows) and, if there are any, the personnel that belong to them (under the appropriate headers).

    My problem is that whenever I do a query on the 2 tables I can only display the companies with personnel in them.

    Any help is greatly appreciated.

    Richard.

  2. #2
    Join Date
    Apr 2003
    Location
    China
    Posts
    54
    OK I pulled out my "Learn SQL in a weekend" and found the answer close to the front of the book (ooops).

    I just used:
    FROM Company LEFT OUTER JOIN Personnel

    Hope this saves some other newbies a sleepless night or two.

    Cheers,

    Richard.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, that is a good solution for a report. But for forms, you really should just create your child-table form as a linked subform in your parent form. Easy to do, and much more practical for data entry and browsing.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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