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 |
|
sfunds
Starting Member
7 Posts |
Posted - 2006-01-28 : 09:15:19
|
| Hi,I have following data strucTable name TradeAccountid char(10) ,trn_date datetime,type int,amountRequiredthere are 25 types I want trn_date , amount , cumulative sum of amount order by trn_dateI cannot use id for query How to achieve it.Next also I want to get difference between amounts between two consecutive rows and between two dates ietrn_date amount diffdate diffamount1/1/2006 10000 - -10/1/2006 20000 10 1000020/1/2006 30000 10 1000020/1/2006 35000 0 5000is it possible thankssfunds@yahoo.com |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-01-28 : 12:07:22
|
| Hi,See if this helps.. select trn_date , sum(amount)from TradeAccountgroup by trn_dateelse Post some data |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-28 : 19:16:20
|
| Use shallu1_gupta's code to get the sum(amount) by trn_date. Use your front-end application to obtain the cumulative sum and difference.----------------------------------'KH'I come I saw I post |
 |
|
|
|
|
|