Error when using Presto's date functions: '>=' cannot be applied to varchar, date

8.1k views Asked by At

I am facing an issue while using presto date functions to get the current day and the previous day’s data.

“An error occurred while communicating with Presto. Bad Connection: Tableau could not connect to the data source. Error Code: 9F80FB23 [Simba][Presto] (1060) Presto Query Error: line 30:37: '>=' cannot be applied to varchar, date (1) [Simba][Presto] (1060) Presto Query Error: line 9:24: '>=' cannot be applied to varchar, date (1)”

Can you please help /suggest us to resolve it?

*where a.event_date <= current_date
*where a.event_date <= date 'current_date' - interval '1' day
1

There are 1 answers

0
Piotr Findeisen On

line 9:24: '>=' cannot be applied to varchar, date (1)

There is no >= in the query you provided, However, i am guessing event_date is a varchar column, so you want something like this:

CAST(a.event_date AS date) <= current_date - interval '1' day