Dan,

thanks for clarification.

On Tuesday, May 6, 2025 at 4:12:28 PM UTC+2 [email protected] wrote:



> In this mode all the additional perks like JOURNAL, OPEN ON, CLOSE ON, 
> BALANCES do not seem to be available. 

Unless there is a bug somewhere, OPEN ON and CLOSE ON are supported also 
when using the new syntax (although they do no always make sense). 
JOURNAL and BALANCES can be thought as macros that expand to a regular 
SELECT query. What do you mean when you write that the new mode does not 
support them?


let us look at the OPEN ON, as seems to be the one, which actually adds a 
new functionality, rather then just being a syntactic sugar

Suppose I have the following: ledger, 

============================

2020-01-01 open Assets:Bank USD
2020-01-01 open Assets:Cash
2020-01-01 open Equity:Initial-Balance
2020-01-01 open Expenses:Food

2020-01-01 * "Initial Balance"
    Assets:Bank          1000.00 USD
    Equity:Initial-Balance


2020-01-02 * "Buy Groceries 2020-01-02"
    Assets:Bank          
    Expenses:Food        1.00 USD

2020-01-03 * "Buy Groceries 2020-01-03"
    Assets:Bank          
    Expenses:Food        10.00 USD

2020-01-04 * "Buy Groceries 2020-01-04"
    Assets:Bank          
    Expenses:Food        100.00 USD

===============================
 
This one works

beanquery> select sum(position) where account ~ "^Expenses"                 
        
sum(positi
----------
111.00 USD

This one also works, when we switch to what I call "a new mode"

beanquery> select sum(position) *FROM #postings* where account ~ 
"^Expenses"                    
sum(positi
----------
111.00 USD

This one also works  in the "old mode"(but expectedly different result)

beanquery> select sum(position) FROM *OPEN ON 2020-01-03* where account ~ 
"^Expenses"
sum(positi
----------
110.00 USD

But this one does not work (I use an OPEN ON with the #postings)

beanquery> select sum(position) *FROM #postings OPEN ON 2020-01-03* where 
account ~ "^Expenses"
error: syntax error
| select sum(position) FROM #postings OPEN ON 2020-01-03 where account ~ 
"^Expenses"
|                                     ^
beanquery>


I am not sure, how much it is a limitation now, but what about the future, 
when JOIN functionality is introduced?



-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/beancount/8f22192e-4e74-4e2c-b24a-aa6ba3a87366n%40googlegroups.com.

Reply via email to