Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with totals query (2000/XP)

    Attached is an extract from a table on which I need to calculate some totals.

    The table has two fields, LocationCode and Type. All I need is the percentage of each Type at each location. I assume what I need to do is simple but my mind has gone blank <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> . Any pointers gratefully appreciated.
    Attached Files Attached Files

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Pennsylvania, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help with totals query (2000/XP)

    Just want to make sure that I understand what you want to do.

    You want to derive a percentage of the number of times that [Type] grouped by [LocationCode] is of the total count of LacationCodes.
    threecrow

    Don&#39;t make excuses. It&#39;s what you do, not why you didn&#39;t.

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

    Re: Help with totals query (2000/XP)

    You can use a crosstab query to calculate the counts, and another query based on the crosstab query to calculate the percentages. See attachment.
    Attached Files Attached Files

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help with totals query (2000/XP)

    Thanks, that's exactly what I was after. I was trying to do it all at once instead of as two queries, so I wasn't getting anywhere.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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