Consulting

Results 1 to 4 of 4

Thread: How do I create a Master Detail Table?

  1. #1
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location

    How do I create a Master Detail Table?

    I am really novice with Access and from what I google, all I found were how to create Master Detail Forms, which I don't think is what I wanted. I needed a table because I need to pull this info into Spotfire to do analysis. My scenario is that I have 2 tables which summarized to an InjuryType and BodyHarmed tables. To make it simple InjuryType contains CaseNumber and InjuryType as fields and BodyHarmed has CaseNumber and TreamentType

    InjuryType
    CaseNumber - 1
    InjuryType - First Aid

    BodyHarmed
    CaseNumber - 1
    TreatmentType - Head
    CaseNumber - 1
    TreatmentType - Leg

    From the perspective when I create a query, I want to get:
    How many First Aid - 1
    How many Treatment Types - 2

    However, when I structure my query, I get 2 First Aid, which the join gives me.... How do I structure my tables to do the above? Thanks.

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    hmm, after posting the thread.... I don't know why i did not think of it... I guess I can query the InjuryType table, this will give me 1 First Aid. Then I can query BodyHarmed table to get my Treatments of 2. Is this the approach to do this?

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    The fact that you are trying to do 2 separate unconnected counts it would probably be best to use 2 queries.
    You can use more than one table in a query and control how the data is presented by using how the tables are "Joined" in th query, but in your case I am not sure it will achieve what you want.
    Are you using Group BY and the functions that that allows, like count, sum, max & min etc?

    Are you restricting the data by Case Number or looking at all cases?

    If you can provide some dummy data and explain what the outcome should be, I can see what works.

  4. #4
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    Thank you for answering... I got it sorted out like you suggested with multiple queries.

Posting Permissions

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