I need to build into a SQL query that this extract will run every Tuesday. I was thinking I could use the date_dimension table that has Day_of_WEek column = Tuesday, or Day_of_Week_Index = 2. But that is all I have. Can someone help with this?
Right now my query is set up like this:
declare @yearmonth varchar(15) = '201709'
INNER JOIN hsp_bkt_snapshot bkt_snap on bkt_snap.snap_start_date <= ar_date.calendar_dt and bkt_snap.snap_end_date >= ar_date.calendar_dt
INNER JOIN hsp_har_snapshot har_snap on bkt_snap.HSP_ACCOUNT_ID = har_snap.HSP_ACCOUNT_ID AND har_snap.snap_start_date <= ar_date.CALENDAR_DT and har_snap.SNAP_END_DATE >= ar_date.CALENDAR_DT