Running examples from BigQuery docs and getting errors for intervals.
SELECT DATE_ADD(DATE "2008-12-25", INTERVAL 5 DAY) as five_days_later;
Returns...
Error: Encountered " <STRING_LITERAL> "\"2008-12-25\" "" at line 1, column 22. Was expecting: ")" ... [Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]
What am I missing here? Legacy SQL is checked.
This example is for BigQuery Standard SQL
Try below
#standardSQL
SELECT DATE_ADD(DATE "2008-12-25", INTERVAL 5 DAY) AS five_days_later
... or just uncheck Legacy SQL :o)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With