I'm trying to convert this MySQL line:
if(DATE_FORMAT(y.first_endperiod,"%Y-%m-%d") = DATE_FORMAT(x.end_period,"%Y-%m-%d"), 1, 0) = 1
to PrestoDB. I have tried using date_format
, date_parse
, and to_char
, and all of them return the following error:
An error has been thrown from the AWS Athena client. SYNTAX_ERROR: line 40:41: Column '%y-%m-%d' cannot be resolved
.
I'm using Athena for querying data from S3 bucket. Any idea how to fix this?