Home > Net >  Same QUERY, different behaviour
Same QUERY, different behaviour

Time:09-18

Fellows,

I have a Google spreadsheet at enter image description here

you can see two groups os cells, orange and green, both isn't showing any values. Ih the green ones the QUERY is

=INDEX(QUERY(gD_YTB!A2:I*1; "SELECT sum(Col6) WHERE Col1 > "&DATE.VALUE(TODAY()-8)))

In this cells, if I change "-8" to "-20" I can access the values and eveything runs fine. But in the orange cells it didn't worked and the QUERY is basically the same

=INDEX(QUERY(FB_Posts!A2:U*1; "SELECT sum(Col18) WHERE Col1 > "&DATE.VALUE(TODAY()-8)))

Any clues?

CodePudding user response:

Dates need to be handled specifically in query. Try this in cell Sumario7!B9:

=INDEX(QUERY({FB_Posts!A2:U}; "SELECT sum(Col18) WHERE Col1 > date '"&text(TODAY()-8;"yyyy-mm-dd")&"' ";0))

{} is instead of *1.

  • Related