Re: Miniscule Share Residuals

2016-10-29 Thread John Ralls
> On Oct 29, 2016, at 11:51 AM, David T. wrote: > >> >> On Oct 29, 2016, at 11:36 PM, John Ralls wrote: >> >> >>> On Oct 29, 2016, at 11:28 AM, David T. wrote: >>> >>> Not sure if this is right, but the following seems to work: >>> >>> SELECT c.mnemonic as SYMBOL, >>> ROUND(SUM((s.quant

Re: Miniscule Share Residuals

2016-10-29 Thread David T. via gnucash-devel
> On Oct 29, 2016, at 11:36 PM, John Ralls wrote: > > >> On Oct 29, 2016, at 11:28 AM, David T. wrote: >> >> Not sure if this is right, but the following seems to work: >> >> SELECT c.mnemonic as SYMBOL, >> ROUND(SUM((s.quantity_num*1.0/s.quantity_denom)), LENGTH(REPLACE(c.fraction, >> '1

Re: ROOT Type accounts

2016-10-29 Thread Alex Aycinena
> > > > -- Forwarded message -- > From: Geert Janssens > To: "David T." > Cc: gnucash-devel@gnucash.org > Date: Sat, 29 Oct 2016 14:54:35 +0200 > Subject: Re: ROOT Type accounts > On Saturday 29 October 2016 17:33:40 David T. wrote: > > OK, so I opened the SQLite file in GnuCash,

Re: Miniscule Share Residuals

2016-10-29 Thread John Ralls
> On Oct 29, 2016, at 11:28 AM, David T. wrote: > > Not sure if this is right, but the following seems to work: > > SELECT c.mnemonic as SYMBOL, > ROUND(SUM((s.quantity_num*1.0/s.quantity_denom)), LENGTH(REPLACE(c.fraction, > '1', ''))) as SHARES /* rounding to the number of precision indica

Re: Miniscule Share Residuals

2016-10-29 Thread David T. via gnucash-devel
Not sure if this is right, but the following seems to work: SELECT c.mnemonic as SYMBOL, ROUND(SUM((s.quantity_num*1.0/s.quantity_denom)), LENGTH(REPLACE(c.fraction, '1', ''))) as SHARES /* rounding to the number of precision indicated in Commodities */ FROM accounts as a, commodities as c, sp

Re: Miniscule Share Residuals

2016-10-29 Thread David T. via gnucash-devel
> On Oct 29, 2016, at 9:44 PM, John Ralls wrote: > > >> On Oct 29, 2016, at 9:16 AM, David T. wrote: >> >> John, >> >> Probably. As in, probably I did something wrong. (What else is new? ) >> >> When I first queried the database, it returned only integers when I >> calculated the shares,

Re: Miniscule Share Residuals

2016-10-29 Thread John Ralls
> On Oct 29, 2016, at 9:16 AM, David T. wrote: > > John, > > Probably. As in, probably I did something wrong. (What else is new? ) > > When I first queried the database, it returned only integers when I > calculated the shares, so I Googled to find out how to get some decimals. My > solutio

Re: Miniscule Share Residuals

2016-10-29 Thread David T. via gnucash-devel
John,  Probably. As in, probably I did something wrong. (What else is new? ) When I first queried the database, it returned only integers when I calculated the shares, so I Googled to find out how to get some decimals. My solution was to multiply by 1.0, which yielded the aforementioned results. 

Re: Miniscule Share Residuals

2016-10-29 Thread John Ralls
> On Oct 29, 2016, at 4:47 AM, David T. via gnucash-devel > wrote: > > Hi, > > Next question regarding commodity data in my GnuCash file. > > I ran a simple SQL query against the SQLite db to count up the total number > of shares by commodity, and I ran into several commodities whose share

Re: ROOT Type accounts

2016-10-29 Thread Geert Janssens
On Saturday 29 October 2016 17:33:40 David T. wrote: > OK, so I opened the SQLite file in GnuCash, went to the COA and > selected Check and Repair All. No change, unfortunately. > Yes, that's what I meant - check & repair should be the place to handle this, but it currently doesn't. I see the wa

Re: ROOT Type accounts

2016-10-29 Thread David T. via gnucash-devel
OK, so I opened the SQLite file in GnuCash, went to the COA and selected Check and Repair All. No change, unfortunately. I will try removing the rows manually and see what happens! This, of course is on a copy of my real data file. ;) David > On Oct 29, 2016, at 5:13 PM, Geert Janssens > wro

Re: ROOT Type accounts

2016-10-29 Thread Geert Janssens
On Saturday 29 October 2016 15:14:55 David T. via gnucash-devel wrote: > Hi, > > I am digging around in the SQL database, and I am noticing that the > accounts table for my data has 46 ROOT type entries. > > Checking in GnuCash, I have 6 top level accounts (Assets, Equity, > Expenses, Income, Lia

Miniscule Share Residuals

2016-10-29 Thread David T. via gnucash-devel
Hi, Next question regarding commodity data in my GnuCash file. I ran a simple SQL query against the SQLite db to count up the total number of shares by commodity, and I ran into several commodities whose share total was in the range of 9.9475983006414e-14. I know that there was a discussion s

ROOT Type accounts

2016-10-29 Thread David T. via gnucash-devel
Hi, I am digging around in the SQL database, and I am noticing that the accounts table for my data has 46 ROOT type entries. Checking in GnuCash, I have 6 top level accounts (Assets, Equity, Expenses, Income, Liabilities, and Special Accounts). Back in the SQL, only one of the 46 has a name