0

I have a worksheet that I am importing data into. Column 4 of the source worksheet contains dates. I would like to import only the rows that are from today() date.

My starting point is:

={unique(QUERY(IMPORTRANGE("URL","Sheet1!A3:L1000"), "select Col9,Col1,Col4,Col3,Col5 where Col1 is not null order by Col4"));}
Robert
  • 114
  • 8

1 Answers1

1

Try adapting the where clause:

where Col1 is not null and Col4 = date '"&text(today(),"yyyy-mm-dd")&"'

So the query becomes:

={unique(QUERY(IMPORTRANGE("URL","Sheet1!A3:L1000"), "select Col9,Col1,Col4,Col3,Col5 where Col1 is not null and Col4 = date '"&text(today(),"yyyy-mm-dd")&"' "));}
Aresvik
  • 4,484
  • 1
  • 5
  • 18
  • Good answer, but I don't think he needs to order by Col4 if what he only wants are rows with the date today. – NightEye Jun 11 '21 at 15:22
  • 1
    Thanks. I left his query as it was; I just added `and Col4 = date '"&text(today(),"yyyy-mm-dd")&"'`. Like you say, the sort is not relevant if the new query only brings back dates for today. – Aresvik Jun 11 '21 at 15:27
  • I understand. Still it works so it's not that big of a deal. – NightEye Jun 11 '21 at 15:27