Article View: borland.public.interbase.sql
Article #386Re: cumulative balance field
From: WillR
Date: Thu, 08 May 2008 23:05
Date: Thu, 08 May 2008 23:05
66 lines
3628 bytes
3628 bytes
Isaac wrote: > Ok guys, but I saw another solution used in the "Peachtree complete > accounting" package it uses the client to update the "running balance". > > First no direct change in the window the user have to open another > window to make the update, > > Then a global flag set for example "balance_need_update = true" and when > the user close the window and the the balance window get the focus a > small progress bar appear indicating of fixing the balance. > > this scenario did not occur if no change happened and also controlled by > the current selected period of the year (3 months) and the update occur > from the modified record down to the end of the selected period so it > take few seconds. > > it is also in my opinion more light to do the calculation on the client > with executing SQLs than using triggers and procedures on the server in > case of 50 user using the software. > > What do you think ? Isaac: Go back to the rules of normalization on this one... (Which are derived from the business rules) But generally, If you store this information in the same table as the transaction, you have dependent data. A "no-no" as I recall. :-) It is better to generate this information "on the fly" and use a stored procedure widget linked to a table and a grid, for example, to display this _transient_ information. If this is a "one-company" one-off package with a highly disciplines accounting group -- it does not matter _as much_, however if there are a lot of accounting updates, you are always re-generating the data -- and storing it back to a table -- which eats time and resources. This is "Date-Timestamped" information, and that is the calculation order, or Date, Sequence number order (hierarchical) ... I have seen companies that demanded immediate payment for outstanding invoices -- when a customer was on pre-pay COD status -- because they always got their balances wrong due to input sequencing errors and just plain sloppiness. Don't underestimate how tricky this calculation can be -- at least if the business rules aren't clear. And of course you have to decide if you are running (account) "balance forward" or "open Item" (on account) on the accounting -- and I recommend "open Item" as a matter of course... Otherwise you can't age things very well. These are more design issues than SQL issues. These design issues are derived from the business rules -- which you did not state. SO hence it is impossible to asses what rules of normalization and sequencing rules should apply. Hope that's clear. -- Will R PMC Consulting
Technical Details
Message-ID:
<4823871c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4822380f@newsgroups.borland.com> <48235cbc@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,7fe0f2b0b1ac1758 X-Google-Attributes: gid114a0e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 08 May 2008 17:05:54 -0600 From: WillR <willrNo.Spam.pmccl.noSpam.com> User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: cumulative balance field References: <4822380f@newsgroups.borland.com> <48235cbc@newsgroups.borland.com> In-Reply-To: <48235cbc@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 189.174.196.62 Message-ID: <4823871c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1210287900 189.174.196.62 (8 May 2008 16:05:00 -0700) Lines: 66 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail