Results 1 to 8 of 8

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

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    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

  2. #2
    New Member
    Join Date
    Jan 2019
    Posts
    2

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

    Need more information. Please provide your code

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    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. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    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. #6
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    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. #8

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    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
  •  



Click Here to Expand Forum to Full Width