Figure

Notice that the balance column retains the values that were assigned to it when it was populated by the query. To the unsuspecting user, they would either get confused, or worse, they would simply use the last number in the column as the final balance. This would not reflect graciously on any of the parties involved.

If this field and technique are utilized, then it requires that the developer recalculate the running balance values every time the data is sorted, filtered, or queried. This would be very time-consuming for the developer. It would also decrease the end-user performance for each of their data operations.

Another way to solve the running balance problem is with a report. Some developers may find this to be an easier way to display the data, because the report can perform the necessary data recalculations when it is executed. In case the sort order is modified, then the calculated balances are always correctly calculated. And, since a report can be displayed on the screen, it does not require the user to physically print the data in order to view it.

Figure 11-8 is a graphical representation of a running balance solution.

Checking Account

Starting Balance $1,234.56

Payee.

Purpose

Date

Amount

fkilance

Conglomo Corp

Salary

1/1/2003

$2,000.00

$3,234.56

Mega-low Mart

Household

1/3/2003

($157 43)

$3,077.08

Electric Co

Electrlciiy

1/5/2003

($94.31)

$2 ¡982.77

Water "Co

Water

1/6/2003

($34.56)

$2 ¡948.21

Insurance Co

Insurance

1/S/2003

($245.04)

$2,703.17

Supermarket

Gro celles

1 0/2003

($132.09)

$2,571.08

Ending Balance :

Figure 11-8

In the previous picture, the Balance column begins with a Starting Balance of $1234.56, which is then added to the first Transaction Amount, and then carried over to each of the remaining individual transactions. At the end of the report, the final balance is restated, for a quick-glance reference of the value.

0 0

Post a comment