Answer the question
In order to leave comments, you need to log in
How to filter by date in timestamp field?
I have a table in hive: table (id, date)
date in format 'yyyy-MM-dd HH:mm:ss'
how to filter for example:
WHERE date = '2020-01-01'
does not return anything
explicit conversion operator required date please help
Answer the question
In order to leave comments, you need to log in
For MySQL you can do this:
WHERE `date` BETWEEN :date AND :date + INTERVAL 1 DAY
It may be different in other dialects.
WHERE date >= '2020-01-01 00:00:00' and date <= '2020-01-01 23:59:59'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question