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 2012 Forums
 Transact-SQL (2012)
 reset running total to x amount

Author  Topic 

ca4fil
Starting Member

1 Post

Posted - 2014-12-22 : 09:13:12
Can anybody help me please? I need to calculate running total which resets when reached to 16, and also needs to calculate remaining amount as paid.
I have attached sample data, so we have two columns Earned, and Used. And we need to calculate Balance, and Paid columns. Many thanks.

Earned Used Balance Paid
5 1 4 0
16 2 16 2
0 2 14 0
2 1 15 0

sz1
Aged Yak Warrior

555 Posts

Posted - 2014-12-23 : 10:32:43
What do you mean, you want to sum the balance and paid columns? or just when they = 16?

We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -