Oohhh, I had this question a couple of years ago. https://money.stackexchange.com/questions/154316/how-can-i-identify-all-transfers-from-account-a-to-account-b-in-ledger-cli
Simon Michael did a good job getting close to solution but these systems are inherently not made for such a thing, unfortunately. If (or when) there is a JOIN statement in bean-query, it would be possible to construct a query that selects postings that are to either of the desired accounts, along with their transaction id, then pivot on the transaction id. This would still not be ideal but would be close. The other, more realistic option at the moment, would be to do it in two steps using a query and a print, then use the new file for a separate query. Anyway, still an interesting and unresolved (in an elegant matter) question. On Thursday, 3 July 2025 at 5:58:14 pm UTC+2 man...@gmail.com wrote: > I'd like to list all transfers between two accounts. For example, to > estimate monthly credit card payments. > > I've tried, > > bean-query bc.bean "SELECT date, payee, narration WHERE account ~ > 'Assets:foo:bar' AND account ~ 'Liabilities:foo:baz'" > > But it returns nothing (because account is one thing, and cannot be an AND > of two things). Can someone help me with this query? I tried ChatGPT and it > was not helpful. > > Thanks, > > -k. > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/beancount/609ffcb9-e9bc-4074-b0e9-8aadc7ddf3a3n%40googlegroups.com.