in reply to Re: Get the date (MySQL style) for X days ago
in thread Get the date (MySQL style) for X days ago

Actually the current_date()-#days code doesn't work when it crosses a month boundary.

Example: 20091005 - 7 = 20090998

Try this instead SELECT DATE_SUB(CURDATE(),INTERVAL 7 DAY)
  • Comment on Re^2: Get the date (MySQL style) for X days ago