What are the date functions like (YEAR(), MONTH(), DATEADD(), DATEDIFF(),...) in standard SQL of Goolge bigquery?
I used functions here when --use_legacy_sql is true, but they don't work with standard SQL.
You can find all Date functions for BigQuery Standard SQL here: https://cloud.google.com/bigquery/sql-reference/functions-and-operators#date-functions
Specifically EXTRACT returns the value corresponding to the specified date part. The part must be one of:
DAYOFWEEK (Returns 1-7, where 1=Sunday ... 7=Saturday)
DAY
DAYOFYEAR
MONTH
QUARTER (Returns 1-4)
YEAR
See also DATE_ADD, DATE_SUB, DATE_DIFF and rest for respectively DATEADD(), DATEDIFF() ...
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