DATE(year, month, day) isn't the same as date in BQL

20 views
Skip to first unread message

Oon-Ee Ng

unread,
Feb 27, 2020, 2:52:47 AM2/27/20
to bean...@googlegroups.com
A simple query like

    SELECT date as d, last(balance)

works just fine. I would expect the following to do the same thing:-

    SELECT DATE(year, month, day) as d, last(balance)

But it errors out with an AttributeError: 'datetime.date' object has no attribute (get_positions). What am I doing wrong?

For clarity, I'm trying to construct a date in my BQL target as a workaround to 'simulate' quarterly dates from output of QUARTER. So my full intention is something like:-

    DATE(SUBST('-Q', '-1-', STR(QUARTER(DATE)))

But this returns the same error as above, because somehow the output of the DATE target isn't actually a date (seems to be an inventory?)
Reply all
Reply to author
Forward
0 new messages