Page 1 of 1

Get AccountID by AccountNum

Posted: Sun Nov 22, 2009 6:40 pm
by elliswr
I'm working on the OFX import, and I need to get the account before I can add transactions to it, but the OFX file will not contain the accountID or the accountName. It does have the accountNumber so I was hoping to get the account with that, and then if the account didn't have an account number have the user select the account manually. Then I could add the accountNum to the account once the user has identified the proper account.

The only problem is that I don't see a way to get the accountID based on the AccountNum. How would I do this?

Re: Get AccountID by AccountNum

Posted: Mon Nov 23, 2009 4:31 pm
by omalleypat
Do you mean what SQL query do you need?

Code: Select all

SELECT ACCOUNTID FROM ACCOUNTLIST_V1 WHERE ACCOUNTNUM LIKE 1234567890
I think you'd want to add a function to dbwrapper.cpp to use this query so you pass it the account number and have it return the account ID.

Re: Get AccountID by AccountNum

Posted: Tue Nov 24, 2009 12:20 pm
by elliswr
Thanks Pat. I probably will end up adding that to the dbwrapper.ccp. Also, I am thinking about adding a new member to the mmTransaction class called fi_id (financial institution identification). This would be very useful for imports from OFX files, as it can be used to prevent duplicate transaction imports. The fi_id is a unique id assigned to each transaction by the financial institution. So when we import OFX files, we check to see if that fi_id already exists in our database, and if it is, skip that transaction. This would be an invisible field (not in any dialogs, reports, etc), and would not be accessible by the end user. Does anyone object to this?

Re: Get AccountID by AccountNum

Posted: Sun Dec 06, 2009 3:09 pm
by madhan
If you are considering changing the Database schema, please let me know. Thanks.