Solved

ACCOUNTING - CALCULATING BALANCE

Posted on 2006-07-06
3
383 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
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
Comment Utility
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
Comment Utility
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 65

Expert Comment

by:Jim Horn
Comment Utility
>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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now