Home > Mobile >  Convert "Fri 12/25/20" to date 2020-12-25 in bigquery
Convert "Fri 12/25/20" to date 2020-12-25 in bigquery

Time:07-23

I uploaded a google sheet into BQ and the date format is "DOW mm/dd/yyyy" and of course BQ recognizes it as a string. I want to convert it to date without the DOW. How can I do this without changing the date format in google sheets (which is not an option)?

CodePudding user response:

You just need to use the CAST as DATE function with the appropriate format string

CodePudding user response:

use below

select parse_date('%a %m/%d/%y', 'Fri 12/25/20')    

with output

enter image description here

  • Related