When I run the below query on the first on a month it returns no data. It is supposed to display the previous day.
The query works ok normally except when it’s the first on the month, am I doing something wrong which will not allow it to see the previous days data as it’s a previous month?
select COUNT(*) from osticket.ost_ticket where DATE(created) = DATE(NOW())-1
You need to use DATE_SUB :