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 |
sangeeta
Starting Member
16 Posts |
Posted - 2005-12-06 : 00:51:24
|
Hi -I am fairly new to SQL and need help in designing query for the following.My data set in the table looks like this:DATA----Symbol TradePrice Cumulative tradesMSFT 256 100MSFT 260 50AA 50.80 100AA 50.80 150MSFT 256 200MSFT 256 350AA 50.90 50MSFT 260 150The Trade quanity in the third column is a cumulative value - cumulated on each change in symbol and price. I am looking to get individual traded quantity where the result set would lokk like:RESULT------Symbol TradePrice Cumulative tradesMSFT 256 100MSFT 260 50AA 50.80 100AA 50.80 50MSFT 256 100MSFT 256 150AA 50.90 50MSFT 260 100Thanks a TON |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-06 : 02:06:44
|
You should properly store the data. Why did you store cumulative data? Store values and use Reports to show the Running Total.Apply the logic suggested by stoadhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=32521MadhivananFailing to plan is Planning to fail |
|
|
sangeeta
Starting Member
16 Posts |
Posted - 2005-12-06 : 02:32:41
|
Thanks -I did not create the data. This is how the data was captured by the system.Thanks for your help.Sangeeta |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|