I am running a script on every Wednesday. So on this coming Wednesday, January 8th the report should include Friday, January 5th through Monday, January 8th.
Starting Wednesday (10-Jan-2017) and every weekday morning thereafter run the query for that day and the prior 3 days. For example on Monday, January 8th the report should include Friday, January 5th through Monday, January 8th.
SELECT ship.id ship_id
FROM dss.shipments ship
WHERE ship.order_id = in_order_id
AND shptrk.ship_id = ship.id
AND shptrk.dt_created BETWEEN -----
shptrk.dt_created as my requirement. Thanks in advance for the help.