Getting OFX import to use DTUSER vs DTPOSTED

Alton Brantley alton.brantley at gmail.com
Sat Jun 10 13:46:50 EDT 2017


After much trial and tribulation (and hours upon hours of transaction editing while importing OFX files), I have discovered the secret to getting OFX import to use DTUSER instead of DTPOSTED. First, a little background:
When I get my credit card statements, they have the date that the transaction occurred at the transaction site, so a Friday night restaurant charge will show up on a Friday date. However, when I download either a QIF file or an OFX file and then import the data, it is almost always a few days off on the transactions. Researching OFX, there are actually two different dates to consider:
DTUSER is the date the transaction occurred( which matches the printed statement) and
DTPOSTED is the date the bank processed the transaction (which doesn’t!).

Inspecting the OFX files, I find both XML tags present. 
There appears to be no way to tell QFX/OFX import which date to use, and apparently if DTPOSTED is present, it supercedes DTUSER.

Here’s the simple solution:

Edit the OFX file and do a replacement of the text “DTPOSTED" with “IGNORE”. The rule for XML is that if a TAG is unrecognized, it is ignored.
That leaves all the dates with DTUSER as the only valid date indication for each transaction, and that’s what get used

I would love to have an option, by account, which would allow me to specify which date entry takes precedence!

-Alton Brantley



More information about the gnucash-user mailing list