I have been trying to create a script that get the previous records from yesterday up to 10 days but cant do it.
I have a table called user_stats_clicks
and a column named dsub
that is a timstamp
This is what tried.
SELECT *
FROM `user_stats_clicks`
WHERE `dsub` = CURRENT_DATE( ) - INTERVAL 1
DAY ORDER BY `user_stats_clicks`.`id` DESC
LIMIT 0 , 30
But it keeps on returning zero results.
How do I get the records from yesterday up to 10 days earlier?