0
votes

I have a Google Sheet that includes a list of dates that documents need to ON our website, and dates documents need to come OFF of our site.

What I'd like to do is create a second tab that includes only the documents that need to come off the site that day - based on the date entered. So it would need to query if the date is on or before today.

Here's what I've cobbled together from other questions/answers - but it doesn't work. It only pulls the first and second row and puts them both in the first row of the new tab:

=QUERY(Sheet!A:M,"WHERE G < date """&text(today(),"yyyy-mm-dd")&""" ")

My sheet is available here: https://docs.google.com/spreadsheets/d/1pq6fhlRLDXMrApTEiwpa-PhmWlG0cYvJy_6SqZDEm4Y/edit?usp=sharing

1

1 Answers

0
votes

Query has a problem dealing with mixed data types like you have in column G. The non-numeric data needs to be filtered out before the query. You will need to copy the header row and format the date columns. Enter this in A2:

=iferror(QUERY(filter(Sheet!A2:M,isnumber(Sheet!G2:G)),"select * where toDate(Col7) <= date '"&TEXT(Now(),"yyyy-MM-dd")&"'"),"No Data Returned")

Currently there is no data in your sheet that is <= today in column G. You can change a data to test it. (I noticed you turn them red).