Tim Dickinson
Tim Dickinson

Reputation: 33

Google Sheets QUERY returning wrong values using >date

Note: Australian date format (DD/MM/YYYY) below.

I have the following formula on Sheet2:

=QUERY ('Sheet1'!$A:$B, "select B where (A>date'"&text ($C$3, "yyyy-MM-dd")&"')", 0)

The source data on Sheet1 ($A:$B) looks like:

The value stored in $C$3 on sheet2 is manually entered, but is currently set to "01/12/2015".

When I run the query it returns me with these values in my data set

Why is the greater than not working for my dates?

e.g. I'm asking the query to give me all dates that occur after the 01/12/2015, but am receiving dates before then (even if the dates were doing something funny with the AU/US date format, it still doesn't make sense).

Upvotes: 1

Views: 899

Answers (1)

Chris Hick
Chris Hick

Reputation: 3094

A FILTER formula may work instead:

=FILTER(Sheet1!B:B,Sheet1!A:A>C3)

Upvotes: 2

Related Questions