Reputation: 1696
I need to make a test on a Date field, so I can get the rows older than 29 days.
My Date field has this format : 2011-01-31 22:18:40
SELECT addeddate FROM status
WHERE addeddate // something to test if addeddate >= 29 days
Any ideas?
Upvotes: 0
Views: 102
Reputation: 27618
Something like:
WHERE addeddate > DATE_SUB(NOW(), INTERVAL 29 DAY)
Upvotes: 0
Reputation: 37364
SELECT addeddate FROM status
WHERE addeddate <= NOW() - INTERVAL 29 DAY
Upvotes: 2