Skip to content
Advertisement

Parse out Y-M-D from Y-M-D H-M-S UTC sql bigquery

I need to parse out '%Y%m%d' from the column in BigQuery. My data looks like this:

I have tried the following:

The error message: No matching signature for function PARSE_DATE for argument types: STRING, TIMESTAMP. Supported signature: PARSE_DATE(STRING, STRING) Desired output: 2000-09-25

Advertisement

Answer

Why not just convert to a date?

Note: This works for both datetime and timestamp values. These are different in BigQuery. You have a timestamp column which you have called datetime — a bit of a misnomer.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement