On Saturday, January 18, 2020 at 10:43:15 PM UTC+7, Andrzej wrote:
>
> When I try to run a date() function it doesn't work in bean-query. 
> Instead, I get following error: 
>
> beancount> select day(DATE('2019-05-01')) limit 10; 
> ERROR: Invalid type for argument 0 of Day: found <class 
> 'beancount.core.inventory.Inventory'> expected <class 'datetime.date'>. 
>

The documentation for BQL says

"You can parse a date with the #”...” syntax; this uses Python’s dateutil 
module and is pretty liberal in the formats it accepts."

So you'd actually write day(#'2019-05-01'). I don't know why you'd want to 
write a query like that, though. It is just going to print the number "1" 
for every transaction in your file, up to a maximum of 10.

-- 
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/c3791eb5-3684-48f6-9796-0611a32a220c%40googlegroups.com.

Reply via email to