simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
3.02k stars 321 forks source link

Q: is there a way to have date2 displayed in the hledger reg --output=csv export #1206

Open lestephane opened 4 years ago

lestephane commented 4 years ago

The hledger hreg help says

With --date2, it shows and sorts by secondary date instead.

But i've been unable to have the date2 column show when doing a csv export.

For example with 2 journal entries with the following dates

2019/12/31=2020/01/02
    ...

2020/01/01=2020/01/02
   ...

Then the following command with --date2 correctly finds those

$ hledger reg -Ocsv --date2 Business-CY:Assets:Girokonto:Revolut:EUR date2:2020-01-02
"txnidx","date","code","description","account","amount","total"
"7500","2019/12/31",...
"7502","2020/01/01",...

But I need the effective date (date2) to be shown in the csv export.

So filtering seems to work, but only date is shown.

Is there a way to affect the csv output to include date2?

simonmichael commented 4 years ago

No, and I don't see it as a bug really, since "we support this for compatibility, but I usually recommend avoiding this feature; posting dates are almost always clearer and simpler." -- https://hledger.org/journal.html#secondary-dates: