QueryStash

QueryStash

From DATE_ADD() or DATE_SUB() to DATE ± n (days)

One of the many recent announcements from BigQuery team regarding new functionality, was the ability to now manipulate dates with a simple + or - operator.

DATE ± n (days)

The amount of times I find my self writing report_date BETWEEN DATE_SUB('2020-11-16', INTERVAL 90 DAY) AND '2020-11-16' is way more than I would like.

The new functionality means that for manipulating the date in DAY interval, the DATE_SUB or DATE_ADD is simply replaced by '2020-11-16' - 90

Public
bigquery

QueryStash

Created: Nov 17th 2020

QueryStash

QueryStash

Made with ❤️ by @Yekalb

© 2024 Query Stash. All rights reserved

TwitterFacebookEmail

Resources

BlogPricingYour First QuerySearch Your Stash

Stay up to date

Terms of ServicePrivacy Policy