Sum of Total Query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • z.ghulam@gmail.com

    Sum of Total Query

    I've designed a query which merely counts the number of different types
    of orders.
    What I am after is a way of getting a Grand Total which will be the Sum
    of all the totals.
    It sounds simple enough, but I just cannot seem to get it working - I
    designed the Query using the Query builder, but have put the SQL below
    if it helps.

    Any help / advice would be greatly appreciated.

    Cheers

    SELECT [Order Type (For Combo)].[Order Type], [Order
    Link].[Re-Allocations], [Order Link].[Project Work], Count(*) AS Total
    FROM [Order Type (For Combo)] INNER JOIN [Order Link] ON [Order Type
    (For Combo)].[Order Type ID] = [Order Link].[Order Type ID]
    GROUP BY [Order Type (For Combo)].[Order Type], [Order
    Link].[Re-Allocations], [Order Link].[Project Work], [Order
    Link].[Order Type ID]
    HAVING ((([Order Link].[Re-Allocations])=No) AND (([Order
    Link].[Project Work])=No));

  • Rich P

    #2
    Re: Sum of Total Query

    Try building a crosstab query from your query. Go to the query builder,
    select Crosstab query and follow the wizard. Instead of selecting a
    table, select the query that contains your totals. The crosstab query
    will list those totals and total them for you at the end of each row.

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    Working...