Using BigQuery and Legacy SQL. I am trying to modify my WHERE statement to look back 3 days if current date is a Monday, otherwise look back 1.
I cannot figure out how to do this.
Currently I am just looking to see if the date is current date -1.
Current code:
WHERE
TIMESTAMP(o.last_modified_on) > DATE_ADD(TIMESTAMP(CURRENT_DATE()), -1, 'DAY')
Any guidance would be appreciated.
Thinking something along these lines (note: this doesn't work)
Where CASE TIMESTAMP(ii.last_modified_on) = TIMESTAMP(CURRENT_DATE()) WHEN
DAYOFWEEK(TIMESTAMP(ii.last_modified_on)) = 2 THEN
DATE_ADD(TIMESTAMP(CURRENT_DATE()), -3, 'DAY') ELSE
DATE_ADD(TIMESTAMP(CURRENT_DATE()), -1, 'DAY') END