4 Answers
- Newest
- Most votes
- Most comments
0
You also might need to use date_diff for subtracting the two dates like in this post: https://stackoverflow.com/questions/58326786/athena-datediff
answered 2 years ago
0
Please refer to this documentation page for a list of all Athena functions, and specifically to this trino documentation page for the Date & Time Function.
Your Query should read as:
SELECT avg(date_diff('day',PZD.ORDER_DATE,current_date)) as MY_DATE_DIFF
FROM PZDTORBK PZD
WHERE PZD.ORDER_DATE > cast('2021-01-01'as timestamp)
hope this helps
Relevant content
- asked 8 months ago
- asked 7 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 6 months ago
I tried it, but it did not work. I am still getting the same error message. Thank you