Skip to content

Instantly share code, notes, and snippets.

@svpino
Created December 18, 2015 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svpino/1af3b5dc5a73f37e0068 to your computer and use it in GitHub Desktop.
Save svpino/1af3b5dc5a73f37e0068 to your computer and use it in GitHub Desktop.
How to determine last Monday's date in BigQuery
select date(date_add(current_date(), if(dayofweek(current_date()) = 1, -6, -(dayofweek(current_date()) - 2)), "DAY"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment