Access Calculation Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sonel
    New Member
    • Sep 2006
    • 1

    Access Calculation Question

    I am new to access and trying to do two calculation in my query.

    TestType CountResults
    Test1 05
    Test2 15
    Test3 20

    I am using Groupby for Testtype and Count for Countresults

    How do I get total for countresults (countresults is not a field on my table) and then get percentages by test.

    Thank you for any assistance,

    Newbie
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    To show a total in the bottom you have to do an Union query like this

    TestType CountResults
    Test1 05
    Test2 15
    Test3 20

    SELECT DISTINCT TestType, Count(Results) AS CountResults
    FROM MYTable
    ORDER BY TestType;

    This query is saved as Query1

    Your Query2 is

    Select DISTINCT "Total" AS TestType, Sum(CountResult s)
    From Query1;


    Your Union Query is:

    SELECT * FROM Query1 UNION SELECT * FROM Query2;

    And it's all!

    :)

    Comment

    Working...