SQL Server Performance

Running Total Problem

Discussion in 'SQL Server Reporting Services' started by fisab, Oct 3, 2005.

  1. fisab New Member

    Hi there - I hope someone can help me with this problem :

    Suppose I have the following info :

    Group Amt Detail
    1000 1
    1000 2
    1000 3
    2000 4
    2000 5
    2000 6

    I can get aggregates at group level by using First(Fields!Amt.value) and Sum(Fields!Detail.value) in the group footer.
    But if I want an overall sum of Amt at the table footer, then Sum(Fields!Amt.value) will give me a value of 9000 rather than the 3000 I want.

    How do I get 3000?

    Many thanks in advance for any help.

  2. ghemant Moderator

    are u looking for this ?!
    From BOL :

    SELECT type, price, advance
    FROM titles
    WHERE type LIKE '%cook'
    ORDER BY type
    COMPUTE SUM(price), SUM(advance) BY type


    Hemantgiri S. Goswami
    "Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemantgiri Goswami

Share This Page