Google Sheets Query function: The Most Powerful Function in Google Sheets
The correct syntax for dates in the Query function
Per the Query Language documentation, we need to include the date keyword and ensure that the date is in the format yyyy-mm-dd to use a date as a filter in the WHERE clause of our Query function.
The new syntax we want will look like this:
date_column greater than date '2000-01-01'
First, we convert it to a serial number format with the DATEVALUE() wrapper:
Then the TEXT() function converts it to the required format for the Query formula by specifying a format of "yyyy-mm-dd":
Next we add single quotes around the new date format, with the "'" syntax. Finally, we insert the word date into the query string, to give: