I seem to be having a case of the Fridays. I am new to MySQL (few weeks now) and I just can’t seem to get a report automated. I need to be able to query data from yesterday 8 am until today 8 am. I am going to schedule the report to run at 10 am. What is the best way to do this? I have been running it manually with BETWEEN but this will not do. I tried to use the interval feature but no luck. I think I am almost there.
purchase_date BETWEEN '2020-11-18 09:00:00' and (DATE(NOW()) - INTERVAL 16 hour)
purchase_date BETWEEN BETWEEN (DATE(NOW()) - INTERVAL 40 hour) and (DATE(NOW()) - INTERVAL 16 hour)
If you can just point me to the function or best option in this case, I should be able to figure out the arguments. Ideas/suggestions/thoughts? Thank you!