Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Financial database / balance?



Have you looked at GnuCash?

-derek

Sent from my HTC on the Now Network from Sprint!

----- Reply message -----
From: "Daniel C." <dcrookston at gmail.com>
Date: Fri, Jan 13, 2012 4:02 pm
Subject: [Discuss] Financial database / balance?
To: "BLU Discuss" <discuss at blu.org>

Hello,

I'm writing some personal finance management software, and I'm
puzzling over the best way to keep track of the balance for each
account.  I've got an accounts table and a transactions table.  I need
a way to get the balance for an account, but the current balance
depends on the value of all transactions tied to that account from now
until the beginning of time.  Obviously summing all transactions for
that account is not the most efficient way of finding the current
balance.

The alternative is to add a balance field to the accounts table and
create a trigger on insert, update or deletion in the transactions
table to update the appropriate account balance.  The risk here is
that, somehow, this will get screwed up or out of whack and then the
account balance won't correctly reflect the sum of all transactions
for that account.  Resetting it would be easy (just re-sum all
transactions for that account) but adding this feature would be
offensively kludgey to me.

I've considered a few other options but none of them really sit right
with me.  Should I just add the trigger to my DB and trust that (if
properly programmed in the first place) it will always work?

Thanks,
Daniel
_______________________________________________
Discuss mailing list
Discuss at blu.org
http://lists.blu.org/mailman/listinfo/discuss



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org