-1

This question already has an answer here:

I have this query

=QUERY(
'Monitor'!$A$4:$AB, 
"select * WHERE " & IF(C2="Yes","A=1 ",IF(C2="No","A=0 ","(A=0 OR A=1) ")) & 
"AND " & IF(ISBLANK(C3),,"D="&C3&" ") & "AND "& IF(ISBLANK(C4),"B IS NOT NULL ",
"B="&C4&" ") & "AND " & IF(ISBLANK(C5),"F IS NOT NULL ","F> "&C5&" ")
)

The last part refers to dates where

C5 = Date in format YYYY/MM/DD

F = Column with dates in same format

I want to get only the rows where the date is larger than that of cell C5.

I don't get an error back, I just get an empty range. I've checked if the other filters could be the reason but they're not.

Couldn't find answer here and do not want to use FILTER.

Any ideas?

marked as duplicate by Rubén, serenesat, jonsca Nov 30 '16 at 1:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Worked like this

=QUERY('Monitor'!$A$4:$AB, 
"select * WHERE " & IF(C2="Yes","A=1 ",IF(C2="No","A=0 ","(A=0 OR A=1) ")) & 
"AND " & IF(ISBLANK(C3),,"D="&C3&" ") & "AND "& IF(ISBLANK(C4),"B IS NOT NULL ", 
"B="&C4&" ") & "AND " & IF(ISBLANK(C5),"F IS NOT NULL ","F> date'"&
TEXT(C5,"yyyy-MM-dd")&"' "))
0

Partial answer

  • The values in the where clause should be enclosed by single quotes '
  • If values are of date type they should be preceded by date

Instead of

"F> "&C5&" "

try

"F> date '"&C5&"' "

Not the answer you're looking for? Browse other questions tagged or ask your own question.