Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query question (A2k)

    I have 9 tables, 3 of which are junction tables, that I need to perform a query on. I need to know if I need the junction tables or just the main tables to achieve the results I need.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query question (A2k)

    Gabi,

    This question (which you asked before, I believe) is so general that it can't be answered. It depends on what you want to accomplish. You will have to be more specific.

  3. #3
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query question (A2k)

    Sorry Hans, I couldn't find the post with this question in it.

    The query is to pull the information I need for the confirmation. I need the Participant info, the class info, the guest info and the payment info.
    The relationships between tblParticipants, tblClasses, tblPayments and tblBilling are all many to many with tblStudentClasses, tblStudentPayments, tblStudentBilling as the junction tables for each respectively. I'm confused as to whether I need both the junction tables and the main tables included in the query.

    I hope this explains it a little better.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query question (A2k)

    For example, if you need fields from tblParticipants and tblBilling in the query, you must add tblStudentBilling to the query, even if you don't add any fields from tblStudentBilling to the query grid. If you omit the junction table, tblParticipants and tblBilling will be unrelated.
    Similar for tblParticipants and tblClasses - if you need fields from both, you must add tblStudentClasses to the query.

    In some cases, you may be able to get by with one "main" table and a "junction" table, without the other "main" table. For example, if you have a main form based on tblStudents, and a subform with classes, the record source of the subform can be a query based on tblClasses and tblStudentClasses. You don't need tblParticipants itself in this query, since you don't need to display student info in the subform - this info is in the main form.

  5. #5
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query question (A2k)

    Okay, that's what I needed to know-I need to include the junction tables in the query even if I don't necessarily need to display any or all of their fields-Right?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query question (A2k)

    Right <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  7. #7
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query question (A2k)

    Yay! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

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