Created
December 18, 2015 15:35
-
-
Save svpino/60cbf56c9935e00fd170 to your computer and use it in GitHub Desktop.
How to determine last 5 business days in BigQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select date | |
from | |
(select date_add(current_date(), -1, "DAY") as date), | |
(select date_add(current_date(), -2, "DAY") as date), | |
(select date_add(current_date(), -3, "DAY") as date), | |
(select date_add(current_date(), -4, "DAY") as date), | |
(select date_add(current_date(), -5, "DAY") as date), | |
(select date_add(current_date(), -6, "DAY") as date), | |
(select date_add(current_date(), -7, "DAY") as date) | |
where dayofweek(date) >= 2 and dayofweek(date) <= 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment