While using this query:
SELECT date_time
FROM test_table
where EXTRACT('epoch' FROM CONVERT_TIMEZONE(replace(timezone, '+', '-'),date_time::timestamp)) >= 1513036800
and EXTRACT('epoch' FROM CONVERT_TIMEZONE(replace(timezone, '+', '-'),date_time::timestamp)) <= 1513555200
limit 10
I am getting this error:
An error occurred when executing the SQL command:
[Amazon](500310) Invalid operation: Invalid data
Details:
-----------------------------------------------
error: Invalid data
code: 8001
context: Invalid format or data given: 0000-00-00 00:00:00
query: 1909217
location: funcs_timestamp.cpp:219
process: query1_59 [pid=25572]
-----------------------------------------------;
1 statement failed.
Execution time: 0.63s
I am unable to use "Extract" function two times in a single query. I have tried to use "Between" as well. but that did not work.
If I remove one of any extract query from the date range. Then it would work.