Retrieve records 1 year before todays date
I'm trying to retrieve all records from a table in my database that were posted(date_added column) anytime before 20 April 2009.
I'd prefer not to store that date in particular, but today's date minus 1 year.
I can currently restrict it to the past year using the following:
....date_added >= DATE_SUB( CURDATE( ) , INTERVAL 1 YEAR)....
but I'd like to ignore those and go for previous posts.
How would I be able to do this?
Just change your >= operator to < (less than)
Heheh. Just like that
I think I had tried that initially, but put it on the wrong query. The pagination query.
Many thanks SJH.