I would actually want to use the date instead of the aux_date whenever the aux_date is missing. I found a (quite ugly) workaround that achieves this: Instead of using
-l "aux_date > [2020/12/19] and aux_date < [2020/12/22]" it seems to work to use -l "(to_string(aux_date) > to_string([2020/12/19]) and to_string(aux_date) < to_string([2020/12/22])) or (to_string(aux_date) == '' and date > [2020/12/19] and date < [2020/12/22]) which is quite ugly, but as I am abstracting via scripts anyway, this should be fine for now. If anyone has a more elegant solution, please let me know :) Thanks, Shredder On Wednesday, December 30, 2020 at 7:23:46 PM UTC+1 Shredder wrote: > > Hey again Martin and everyone, > > I'm still getting problems as not all of my transactions contain > aux_dates, which results in this error: > > While comparing if is less than 2020/12/22: > While handling posting from streamed input: > Error: Cannot compare an uninitialized value to a date > > Any ideas how this can easily be resolved? > > Thanks, > Shredder > > On Wednesday, December 30, 2020 at 7:02:15 PM UTC+1 Shredder wrote: > >> Hello Martin, >> >> amazing, this works like a charm. Thanks for your quick reactions, they >> help me a lot :) >> >> Shredder >> >> On Wednesday, December 30, 2020 at 4:34:58 AM UTC+1 Martin Michlmayr >> wrote: >> >>> * Shredder <[email protected]> [2020-12-29 09:43]: >>> > I would like to filter transactions based on the auxdate (effective >>> > date), i.e. use something equivalent to -b [Date] and -e [Date], but >>> > for the auxdate. I am not using the --aux-date/--effective option >>> > because I would still like to display the normal date in the report >>> > output. Do you have any ideas what would be the best way to achieve >>> > this? >>> >>> ledger -f d reg -l "aux_date >= [2020-10-02]" >>> >>> -- >>> Martin Michlmayr >>> https://www.cyrius.com/ >>> >> -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/cbc3252b-9233-42f1-ba5c-37a3c6e97b15n%40googlegroups.com.
