sim
sim

Reputation: 105

Amazon Athena: Dateparse shows Invalid Format

I have a CSV file having Orderdate as string in it. In Amazon Atena trying to use dateparse to convert the format of data but getting error. This is what i am trying:

select parse_datetime(orderdate,'%m/%d/%y %H:%i:%s') from orders

Error: INVALID_FUNCTION_ARGUMENT: Invalid format: "9/1/2015 15:43"

Upvotes: 2

Views: 18463

Answers (1)

John Hanley
John Hanley

Reputation: 81424

The error means that your format string '%m/%d/%y %H:%i:%s' does not match the orderdate string.

Your orderdate does not have seconds and the year is 4 digits. Change your format string to '%m/%d/%Y %H:%i'

Date and Time Functions and Operators

Upvotes: 3

Related Questions