The previous example returns the closest date to now() that is before or equal to now(), even if there is a closer date after now(). If you want the absolute closest date try something like:
Code:
SELECT date FROM table ORDER BY abs(now() - date) LIMIT 1
Last edited by ralph l mayo; 08-29-2008 at 07:17 AM..
Reason: typo