问题
I am using Google Sheets query function to bring data from a different sheet. This query works perfectly, matching two text fields (Where A='"&A5&"')
=query('Modifications'!$A$3:$I,"Select E,F,G,H,I Where A='"&A5&"'order by E desc limit 1")
However, when I try to add an AND statement as part of the Where clause to filter by today's date ( now() ), the query returns nothing:
=query('Modifications'!$A$3:$I,"Select E,F,G,H,I Where A='"&A5&"' AND F>now() order by E desc limit 1")
What am I missing?
回答1:
try like this:
=QUERY('Modifications'!$A$3:$I,
"select E,F,G,H,I
where A = '"&A5&"'
and F > date '"&TEXT(TODAY(), "yyyy-mm-dd")&"'
order by E desc
limit 1", 0)
来源:https://stackoverflow.com/questions/55815530/google-sheets-query-where-datenow-returns-nothing