Solved

ACCOUNTING - CALCULATING BALANCE

Posted on 2006-07-06
3
390 Views
Last Modified: 2012-05-05
Hello,

assuming the table below as instance:

DESCRIPTION               DEBIT        CREDIT        BALANCE
________________________________________________
check cashed                    0               500              12050
rent                               1000             0                11050
check cashed                    0               120              11170

After insert all those values, let's say I need to change the first credit, from 500 to 600. Once I do that, all the next records must be recalculated. I don't need just to get the total balance, but it should be calculated row by row, to update all the next rows.

I thought I could do getting all the values in a gridview and than calculate. But it's a too slow way. I thought in T-SQL or even do without bind a grid to calculate.

What's the best way to do that?

Thanks.
0
Comment
Question by:starusa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 250 total points
ID: 17053447
I'm going to go out on a limb here and state that that would violate one of the primary rules of Accounting, never change a posted transaction.
If you need to make a correction, say from 500 to 600, then I believe you will have to create a new record with a credit of 100, and a description that explains it.

Hope this helps.
-Jim
0
 

Author Comment

by:starusa
ID: 17054027
Thanks, that's an excellent point.

I'm developing a system using asp.net. The current system is written in classic asp, I'm just writing it again and trying to do some changes to optimize it. Today, all the credits and debits are recorded and then, the balance is updated when a button, "calculate" is clicked.

The best way is update the balance when the new record is inserted, right?

Thanks!
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 17054052
>The best way is update the balance when the new record is inserted, right?
Since the balance is calculated every time a record is inserted, pretty much everywhere, then yes this would be the case.

Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question