MFR
MFR

Reputation: 2077

Create Bigquery table using edit text to parse date

I wish to create a table using edit text. The reason that I don't use auto detect is that my date format is not in the US format and Bigquery doesn't understand it (I'm not sure if it is a bug or I'm missing something). When I use Auto detect, Bigquery reads the date as mm/dd/yyyy while my date format is dd/mm/yyy.

I've tried the below but I'm getting an error

enter image description here

State:string,
New_Existing:string,
PARSE_DATE('%d/%m/%Y', Prd_Dt):DATE

Upvotes: 2

Views: 5040

Answers (1)

Anjela B
Anjela B

Reputation: 1201

You can use JSON to write your schema using edit text, refer to this GCP Documentation. Using your scenario below this is how we applied it to JSON: enter image description here

Output: enter image description here

However, you can only use the PARSE_DATE function in Bigquery when doing DML statements such as SELECT as per this GCP Documentation.

Upvotes: 5

Related Questions