'Convert Date to Text in BigQuery

I need to convert date to text format in bigquery. I used below sytax in my query- STRING(DATE(TimeStanmp_1)). please let me know if this is correct



Solution 1:[1]

Syntax you use formally correct, but you don't need to use STRING function here because DATE returns string by itself

So below version should give you the same

DATE(TimeStanmp_1)

Try below to see this:

SELECT STRING(DATE(CURRENT_TIMESTAMP())), DATE(CURRENT_TIMESTAMP()) 

hover output fields names to see data type

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikhail Berlyant