n8than_byte
n8than_byte

Reputation: 11

Date Filter by Cell Reference in Google Sheets

I have a dynamic range of points of data that I would like to add a date filter by a cell reference and seem to be getting a 'parse error'. I have compared to a sheet that I have built out and seems to be in the exact same format.

This one I have an error

=QUERY(IMPORTRANGE("URL","Sheet1!A:B")"select Col1, Col2 where Col2 > date'"&TEXT(H1,"yyyy-mm-dd")&"'")

Where as this one below works perfectly fine for my other sheet.

=QUERY(IMPORTRANGE("URL2","Sheet2!A1:Y"),"select Col1, Col11, Col13, Col6, Col16,Col3,Col20 where Col3 > date'"&TEXT(F1,"yyyy-mm-dd")&"'order by Col3 ASC")

H1 is a reference for the past 30 days dynamically so there is no need to manually update this date every day.

Upvotes: 1

Views: 373

Answers (1)

Mike Steelson
Mike Steelson

Reputation: 15328

May be

=QUERY(IMPORTRANGE("URL2","Sheet2!A1:Y"),"select Col1, Col11, Col13, Col6, Col16,Col3,Col20 where Col3 > date'"&TEXT(F1,"yyyy-mm-dd")&"' order by Col3 ASC")

with a space before order by

Upvotes: 1

Related Questions