Reputation: 13
I need to insert string “10/11/2019 12:34:45” into datetime column in bigquery , please advise any options ?
Upvotes: 1
Views: 2255
Reputation: 173190
Below is for BigQuery Standard SQL
you can use
PARSE_DATETIME('%d/%m/%Y %T', datetime_col_as_string) datetime_col_as_datetime
for example, SELECT PARSE_DATETIME('%d/%m/%Y %T', '10/11/2019 12:34:45')
produces datetime value as in below
Row datetime_col_as_datetime
1 2019-11-10T12:34:45
Upvotes: 1