LaurenzWiskott2 · GitHub

Given the file date2.ledger

2021-01-01 A
    all:account1                                                          100.00 EUR ; date2:2020-02-01
    all:account2

I get the results (with hledger 1.23 5895a46 linux-x86_64 on Linux 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux):

linux> hledger -f date2.ledger reg --date2 account1
2020-02-01 A
all:account1                        100.00 EUR    100.00 EUR
linux> hledger -f date2.ledger areg --date2 account1
Transactions in all:account1 and subaccounts:
2021-01-01 A
al:account2                         100.00 EUR    100.00 EUR

Why does areg not use date2? Looks like an inconsistency to me.

Simon Michael wrote me:


I'd guess it's because areg reports transactions, while reg reports postings. That sounds ok to me.

The situation is unclear though:

  1. https://hledger.org/hledger.html#aregister says "Each aregister line item shows: • the transaction's date (or the relevant posting's date if different, see below)"

  2. https://hledger.org/hledger.html#aregister-and-custom-posting-dates says "Transactions whose date is outside the report period can still be shown, if they have a posting to this account dated inside the
    report period. (And in this case it's the posting date that is shown.)"

  3. The aregister command contains this comment: "TODO: need to also pass the queries so we can choose which date to render - move them into the report ?"

I'm not seeing the behaviour described by 2. Even if I declare the secondary date on the transaction rather than the posting, --date2 doesn't display it or match on it.

So I'd welcome a bug report or PR, changing either the docs or the behaviour, for further testing. There may be some deeper implementation/design/usability reasons, but I don't remember them.


I would argue that areg should really respect the date2: tag.

Firstly, because that is what the user intuitively expects. The normal user is not very
sensitive to the difference between transaction and posting.

Secondly, because it is really useful, in my view, to have this date2 option, in
particular since "As a quick rule of thumb, use aregister for reconciling real-world
asset/liability accounts and register for reviewing detailed revenues/expenses." as is
written in the hledger manual. For reconciling with the real-world accounts the postings
should be dated with the date used in the account. But these latter dates usually differ
between postings of the same transaction, so one should use the posting dates and not the
transaction dates. Looks quite obvious to me.

Read the original on github.com ↗