'BigQuery parse_datetime issue

I need to convert string into date in GCP BigQuery . String format is "29-NOV-15 12.00.00.000000000 AM"

While I am suing SELECT parse_datetime('%d-%b-%y %H.%M.%S.%E*S %P', pg) , pg FROM abc

It's throwing me error saying

Failed to parse input string "29-NOV-15 12.00.00.000000000 AM".

Can someone pls look into this and point me the error.



Solution 1:[1]

use below instead

SELECT parse_datetime('%d-%b-%y %H.%M.%E*S %p', pg) , pg 
FROM abc     

with output (for sample string in your question)

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikhail Berlyant