Phuc Trinh
Phuc Trinh

Reputation: 455

Error: Invalid timestamp: '2017/05/16 19:33:49' BIGQUERY

I have a string '2017/05/16 19:33:49' and I'm getting an error when I try to convert it to the TIMESTAMP:

Error: Invalid timestamp: '2017/05/16 19:33:49'

I want to use CAST function to convert it to TIMESTAMP. How can I do it?

Upvotes: 0

Views: 4544

Answers (2)

Avinash Kumar
Avinash Kumar

Reputation: 21

Try this:

SELECT CAST("2017/05/16 19:33:49" AS DATETIME);

Upvotes: 0

Pentium10
Pentium10

Reputation: 208042

SELECT PARSE_TIMESTAMP("%Y/%m/%d %H:%M:%S", "2017/05/16 19:33:49") as parsed;

Upvotes: 5

Related Questions