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.
Author |
Topic |
learntsql
524 Posts |
Posted - 2009-06-29 : 08:34:21
|
Hi AllIn my Report i have to show as followingName count total A 10 35 B 5 25 C 20 20But how can display total column based on Count column which starts counting total from last row.Thanks. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-29 : 08:41:33
|
As far as I can see, the total column is displayed.What is your objective? Do you want to SORT things? N 56°04'39.26"E 12°55'05.63" |
 |
|
learntsql
524 Posts |
Posted - 2009-06-29 : 08:49:20
|
sorry if am not clear,my query returns Name and count columnsand i need to build Total column in report itself;and that is also from end of the last row of count andding it to previous row.for eg;C contains value of itself becoz its last rowB contains sum(B+C) i.e 5+20=25A contains sum(A+B+C) i.e 10+5+20=35what is the best way please suggest me. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-29 : 09:03:37
|
You can do the running total in SQL Server and then ORDER BY in your report any way you want. N 56°04'39.26"E 12°55'05.63" |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-29 : 09:05:13
|
Can Reports calculate running total in reverse order ?Here is the query way.select *, Total = (select sum([Count]) from data x where x.[Name] >= d.[Name])from data d KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|