0
votes

I have a timestamp column in query with format "2019-03-18 17:17:07.543200 UTC ", the default timestamp format for Bigquery standard SQL.

When triying to plot a chart displaying the date as Year and week, I get this error "Syntax error: Unexpected ")" at [1:817]"

I don't understand since it's the default timestamp format, the one returned with current_timestamp() in Bigquery... and it works with all the others combinations (day, month, year, yearmonth, year quarter.....)

Any hints??

Thank you

1

1 Answers

0
votes

do extract year and WEEK from timestamp

select  EXTRACT(YEAR from timestamp),EXTRACT(WEEK from timestamp)