# Thread: How to calculate balances at runtime with Dr/Cr

1. ## How to calculate balances at runtime with Dr/Cr

Hi

I have below report & i want to calculate Balances with Dr/Cr. How it can be calculated by Formula. On Change of Account No group reset to 0

Code:
```Account	Name	DocumentNo	DocumentDate	Narration	Debit	Credit	Balance
1	Loan 	                               Opg. Balance		0	15200	Cr
11	        01-10-2019	By Loan - 011	6013
12	        14-10-2019	By Loan - 210	0	4000

2	Cash			               Opg. Balance		0	0	Cr
14	        14-10-2019	By Cash	0	        35999```
Thanks

3. ## Re: How to calculate balances at runtime with Dr/Cr

Well, the balance is the sum of all credits minus the sum of all debits ... normally I'd sum(credit) - sum(debit) group by (account) ... but you have holes in your data... so....

-tg

4. ## Re: How to calculate balances at runtime with Dr/Cr

Hi

Above data received through Stored Procedure

I want in Document No 11 it should show balance as 9187 Cr
In Document No 12 it should show balance 13187 Cr

In Document No 14 balance should be 35999 Cr

Thanks

5. ## Re: How to calculate balances at runtime with Dr/Cr

Hi

Above data received through Stored Procedure

I want in Document No 11 it should show balance as 9187 Cr
In Document No 12 it should show balance 13187 Cr

In Document No 14 balance should be 35999 Cr

Thanks

6. ## Re: How to calculate balances at runtime with Dr/Cr

1) That's not quite what you asked for. What you're looking for is the Running total. Not the balance.
2) Do it inside the stored proc. The data is there, you're already doing half of the calculations there, just finish it off.

-tg

7. ## Re: How to calculate balances at runtime with Dr/Cr

Hi Techngome

Through Stored Procedure i am able to do . But i want to know how it can be done thru Running Total or Formula .

Thanks

8. ## Re: How to calculate balances at runtime with Dr/Cr

Hi Mighty

Hi

Above data received through Stored Procedure

I want in Document No 11 it should show balance as 9187 Cr
In Document No 12 it should show balance 13187 Cr

In Document No 14 balance should be 35999 Cr

I am able to do thru Stored Procedure but i want to know how it can be done thru Running Total or Formula.

Thanks

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured