[GNC] Export-import GnuCash historical prices
sunfish62 at yahoo.com
sunfish62 at yahoo.com
Tue Nov 25 14:01:47 EST 2025
I don't know if this will help, but try it and see what you get. I believe it also gives the number of shares owned, but it's been a while.
SELECT c.mnemonic, c.guid,
ROUND(SUM((s.quantity_num*1.0/s.quantity_denom)), LENGTH(REPLACE(c.fraction, '1', ''))),
MIN(t.post_date), MAX(t.post_date)
FROM accounts as a, commodities as c, splits as s, transactions as t
WHERE (a.account_type='MUTUAL' OR a.account_type='STOCK')
AND a.guid=s.account_guid AND s.tx_guid=t.guid AND a.commodity_guid=c.guid
GROUP BY c.mnemonic
David T.
On Nov 25, 2025, 7:48 PM, at 7:48 PM, David Carlson <david.carlson.417 at gmail.com> wrote:
>I recently lost most of the historical prices out of my main data file.
> I
>have backups with the old price data intact. I want to export them
>from a
>backup and import them into my current file. I have saved the backup
>in
>mysql format and found the price table but it is using guid's instead
>of
>currency names and commodity names. I don't know how to create a
>proper
>csv file to import the prices into my current data file. Has anyone
>done
>something similar in the past?
>
>--
>David Carlson
>_______________________________________________
>gnucash-user mailing list
>gnucash-user at gnucash.org
>To update your subscription preferences or to unsubscribe:
>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