Account Balance

Phil Longstaff phil.longstaff at yahoo.ca
Wed Dec 7 13:28:02 EST 2011


Hi Mark,

if you use the query:

SELECT account_guid, reconcile_state, sum(quantity_num) as quantity_num, quantity_denom FROM %s GROUP BY account_guid, reconcile_state, quantity_denom ORDER BY account_guid, reconcile_state


then you will get a select response with rows of:

account guid, reconciled state, total (numerator), denominator

I think it is true that for all splits within an account, the denominator is the same.  If not, you will need to appropriately combine rows.  Of course, the value is numerator divided by denominator.  If you don't care about reconcile state, just ignore that bit.

Phil


________________________________
 From: Mark Gillis <mark at untangledweb.co.uk>
To: gnucash-user at gnucash.org 
Sent: Wednesday, December 7, 2011 12:37:19 PM
Subject: Account Balance
 
I'm writing some queries to extract data from the MySQL backend database for
GnuCash. I've got most of what I need but I'm struggling to locate a data
item for the Account Balance. Is this actually stored in the database or is
it calculated from the other data items? If the latter, does anyone have the
formula for the account running total balance? (It's the total number of
shares, shown in the Balance column of a Share Account that I'm after, if
that makes any difference)
Cheers
Mark 

--
View this message in context: http://gnucash.1415818.n4.nabble.com/Account-Balance-tp4169820p4169820.html
Sent from the GnuCash - User mailing list archive at Nabble.com.
_______________________________________________
gnucash-user mailing list
gnucash-user at gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list