Good afternoon. I am putting together a page with reports based on the amount of sales a bar made.
There is only one problem. I need to generate a sales report per day until I got it done by grouping "SELECT count(id) total, DATE(data_abertura) abertura from vendas group by abertura limit 15";
But this is coming back wrong for the following reason that the bar opens day 19 for ex and will only close day 20 so a command can be opened day 20 midnight and a half being the bar opened on the 19th and this sale should be computed as day 19.
Any tips on logic or query how to solve this impasse?