« Return to Thread: Closed Accounts on Database

Re: Closed Accounts on Database

by Fernando Vilas-2 :: Rate this Message:

Reply to Author | View in Thread

On Thursday 09 July 2009 04:33:31 allan wrote:

> Fernando Vilas wrote:
> > On Wednesday 08 July 2009 16:48:57 allan wrote:
> >> Thomas Baumgart wrote:
> >>> On Wednesday 08 July 2009 17:56:15 allan wrote:
> >>>> Hi
> >>>>
> >>>> Probably, I'm missing it, but how do I find from the database, which
> >>>> accounts have been closed?
> >>>
> >>> Open the accounts view and use the "View/Show all accounts" menu item.
> >>
> >> Er, no, Thomas!  I mean the "database" database, as in mysql.
> >>
> >> allan
> >
> > select kmmaccounts.id, kmmaccounts.accountname
> > from kmmaccounts inner join kmmkeyvaluepairs
> >    on kmmaccounts.id = kmmkeyvaluepairs.kvpid
> > where kmmkeyvaluepairs.kvptype = 'ACCOUNT'
> >    and kmmkeyvaluepairs.kvpkey = 'mm-closed'
> >
> > That query should point you in the right direction.  Obviously the select
> > list isn't that important, but the FROM and WHERE clauses are.
>
> Hi Fernado
>
> Many thanks.  I'll give that a wizz later.  I must admit I didn't think
> to look at kmmkeyvaluepairs.
>
> allan
>
Hi Allan,

        Many things are stored as kvp, so if you don't see a column for something, it
is probably in that table.  I forgot something in the above query: you
probably also want to look at kmmkeyvaluepairs.kvpdata in the select list to
see if it really is closed.

I don't know why an account would have an entry in the kvp table for mm-closed
if it is not closed, but it is possible.  You can always add a constraint to
the where clause to filter results if you need.

--
Thanks,
Fernando Vilas
fvilas@...



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
KMyMoney2-developer mailing list
KMyMoney2-developer@...
https://lists.sourceforge.net/lists/listinfo/kmymoney2-developer

signature.asc (204 bytes) Download Attachment

 « Return to Thread: Closed Accounts on Database