I am querying 365 days worth of Google Analytics data and the data is exported as:
20170726
What I want is it parsed in some form:
2017-07-26
07/26/2017
07/26/2017
I believe I should be using the FORMAT_DATETIME clause/method to be using accomplishing this, and am have it like this:
SELECT
FORMAT_DATETIME(%m/%d/%Y, date)
date being the field in Google Analytics.
Below is for BigQuery Standard SQL and assumes your date field is of STRING type
with result
You can try this for standardSql
PARSE_DATE('%Y%m%d', date) as date,
You'll want to use this instead.
SELECT CONVERT(VARCHAR, [your_date_field] , XXX)
where XXX is an integer value that tellsCONVERT()
which format you want your date to be. I believe you could use101
for your purposes.