in reply to Working with mySQL date's
Probably will be easier to do just using functions in mySQL, with less brain damage. As an example, I found this in the mySQL online documentation, which may suggest a course for you (first example on that page):
mysql> SELECT something FROM tbl_name WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
Using that as a basis, you could do something like:
mysql> DELETE FROM tbl_name WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) > 31;
Hope that helps. (The use of that code from a perl script is left as an exercise for the reader. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Unix timestamp goodness
by Anonymous Monk on Jul 03, 2003 at 19:44 UTC |