1
votes

I want to set query and importrange formula where i want the new sheet to show date that fall into today and yesterday date only and sort in ascending date and time

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1xk0Cvafixr5dayJkBkrzlYLFoA4E_PHYfPNQis12rc8/edit#gid=1702961582","CONSOLIDATE!A1:H"),"Select Col1,Col2,Col3,Col4,Col5,Col6,Col8 where Col1 <= date '"&text(B1,"yyyy-mm-dd")"' and >= date '"&text(B2,"yyyy-mm-dd")"' and order by Col1,Col2")")"

enter image description here

1
Hi! If the answer below has solved your problem, please remember to Click the Tick, and accept it: This helps anyone else with the same issue, arriving here from a Search Page, to what they need to do! :¬)Chronocidal

1 Answers

0
votes

A couple of syntax errors, should be:

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1xk0Cvafixr5dayJkBkrzlYLFoA4E_PHYfPNQis12rc8/edit#gid=1702961582","CONSOLIDATE!A1:H"),"Select Col1,Col2,Col3,Col4,Col5,Col6,Col8 where Col1 <= date '"&text(B1,"yyyy-mm-dd")&"' and Col1>= date '"&text(B2,"yyyy-mm-dd")&"' order by Col1,Col2")

i.e. remember to put '&' after the date as well as before, but don't put 'and' before order by.