Reputation: 651
I store date as integer in my table
Now i wish to get all those records which are 1 day older
I use the following code. But it does not work
SELECT * from points where point_date < now() - interval 1 day
Upvotes: 1
Views: 71
Reputation: 77856
Try using FROM_UNIXTIME()
function and see how it works.
SELECT * from points where FROM_UNIXTIME(point_date) < (now() - interval 1 day)
Upvotes: 1
Reputation: 240860
SELECT * from points where point_date < DATE_SUB(now() ,INTERVAL 1 DAY)
Upvotes: 4