I'm looking for a way to add a calculated balance column on each row that contains a running balance by taking the balance value from the previous row and adding/subtracting values from current row to arrive at a new balance.

result set includes "increase" and "decrease" columns:

You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

## Question

## focus54

I'm looking for a way to add a calculated balance column on each row that contains a running balance by taking the balance value from the previous row and adding/subtracting values from current row to arrive at a new balance.

result set includes "increase" and "decrease" columns:

Increase ----- Decrease ------- Balance (calculated)

100 --------------------------- 100

400 --------------------------- 500

---------------- 200 ---------- 300

-200 --------------------------100

--------------- -300 ---------- 400

These values will be currency with 2 decimals but I think we can ignore that for now.

## Link to comment

## Share on other sites

## 6 answers to this question

## Recommended Posts

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Note:Your post will require moderator approval before it will be visible.