I have a BigQuery table with a column Date
which is a date
type. I am trying to run this query:
SELECT * FROM dataset.table_name WHERE Date = "2016-07-11"
This throws the error:
Argument type mismatch in function EQUAL: 'Date' is type int32, '2016-07-11' is type string
I have also tried this query:
SELECT * FROM dataset.table_name WHERE Date = TIMESTAMP("2016-07-11")
but this returns 0 results, although my table contains at least one record with this value (2016-07-11
) in the Date
column.
So, how can I compare a date
field in BigQuery?