clucko87
clucko87

Reputation: 89

How do I cast a timestamp column as a MM/DD/YYYY in BigQuery

I'm trying to cast the results of an entire column in BigQuery in MM/DD/YYYY format

Time_Column
2022-05-26T17:32:41.000Z
2022-05-28T06:34:23.000Z

Results: enter image description here

Upvotes: -1

Views: 359

Answers (1)

D-Shih
D-Shih

Reputation: 46249

We can try to use FORMAT_DATE function to make it, we can refer to this link Supported Format Elements For DATE to use your expected date format from the datetime type.

SELECT FORMAT_DATE("%m/%d/%Y", Time_Column) 
FROM T

Upvotes: 1

Related Questions