I am generating reports for the periods Yesterday, Month to date and Sat-Fri so I create the dates in PHP and pass them to a function to be used in the BETWEEN phrase of a query.
This could run almost any day of the week but most probably the Friday itself.
I have figured it out for yesterday
Expand|Select|Wrap|Line Numbers
- $start = date('Y-m-d',strtotime('-1 day'));
- $finish = date('Y-m-d',strtotime('-1 day'));
Expand|Select|Wrap|Line Numbers
- $start = date('Y-m-01');
- $finish = date('Y-m-d');