In Bigquery's legacy SQL, I can get the start of week for a date by using
SELECT DATE((UTC_USEC_TO_WEEK(TIMESTAMP_TO_USEC(TIMESTAMP('2017-04-13 20:58:06 UTC')), 0)))
which returns 2017-04-09
.
Is there a way to do this in BigQuery's standard SQL? There doesn't seem to be any equivalents for UTC_USEC_TO_WEEK
and UTC_USEC_TO_MONTH
.