Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 sorting group on a SUM

Author  Topic 

epinaud
Starting Member

2 Posts

Posted - 2006-02-15 : 14:07:58
I have a simple report with one group, which shows no details, but some totals in the group header (COUNT, and SUM) - I cannot figure out how to have the report sort in descending order on the SUMmed field - in other words, I want the report to show the group with the highest SUM at the top, and then in descending order...I keep getting error messages that one cannot sort on an expression which contains aggregate functions...

Please help...

jhermiz

3564 Posts

Posted - 2006-02-16 : 00:15:13
SELECT
EmpID,
Sum(SALES) AS TheSale
FROM
EmpSale
GROUP BY EmpID
ORDER BY TheSale DESC




Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

skourangi
Starting Member

7 Posts

Posted - 2006-04-20 : 20:41:30
Do you just get a Sum and not individual numbers per record in the detail row?

Every time I drag a number/amount field into a table detail row it gives me a Sum (total of all the rows) instead and won't let me change it.

Has anybody else experienced this? Please let me know!

Thank you.
Go to Top of Page
   

- Advertisement -