I want to convert datatype of string (eg : '2018-03-27T00:20:00.855556Z' ) into timestamp (eg : '2018-03-27 00:20:00').
Actually I execute the query in Athena :
select * from tb_name where elb_status_code like '5%%' AND
date between DATE_ADD('hour',-2,NOW()) AND NOW();
But I got error :
SYNTAX_ERROR: line 1:100: Cannot check if varchar is BETWEEN timestamp with time zone and timestamp with time zone
This query ran against the "vf_aws_metrices" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 6b4ae2e1-f890-4b73-85ea-12a650d69278.
Reason : Because date in string format and have to convert into timestamp. But I don't know how to convert it.