That is exactly what I was looking for! I did not know about cost_date. 
Also thanks for the tip on #'dd-mm-yyyy' I'll keep that in mind.

Looking back at the docs and guide I don't think cost_date is really 
documented there, besides digging through the code is there a reference I 
can refer to in the future?

Thanks so much!

On Thursday, 26 May 2022 at 22:57:23 UTC+2 [email protected] wrote:

> On 26/05/2022 20:26, Philippe Dumonet wrote:
>
> > query> select first(date), account, sum(position) where currency != 
> > 'EUR' AND date <= #'26-05-2021' GROUP BY account, currency
>
> By the way, I advise against using the #'26-05-2021' format to specify 
> dates, especially if you use a day-month-year date format: it does not 
> do what you expect if the day number is less than 13 as it defaults to 
> the month-day-year date format.
>
> The #'...' date literals are so confusing that I'll most probably remove 
> support for them from beanquery in the near future.
>
> bean-query understands date literals in the YYYY-MM-DD format, in this 
> example, you can simply write:
>
> SELECT first(date), account, sum(position)
> WHERE currency != 'EUR' AND date <= 2021-05-26
> GROUP BY account, currency
>
> Cheers,
> Dan
>
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/beancount/3309e38c-edd6-4bcb-a47f-7b9bd0d6142cn%40googlegroups.com.

Reply via email to