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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Summing up to a specific value

Author  Topic 

sqldbaa
Starting Member

32 Posts

Posted - 2008-03-05 : 09:29:24
Hi,

I have a table with columns accountid,date, quantity and price. For generation of a report in need to sum the quantity. But i need to stop summing the quantity once the quantity =2000000 and at that date i need to find (quantity* price) for each id.

Please help me in writing a query.

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-05 : 09:59:47
Post your table DDL, sample data and expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -