* Jamil Ahmed
> is this a mysql Bug ?
>
> curdate()-3 returns 20020299
> curdate()-2 returns 20020300

No, curdate() returns "today" as a "date string" or as a number, based on
the context in which it is used. From the manual: "Returns today's date as a
value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function
is used in a string or numeric context"

Use this syntax:

mysql> select curdate() - interval 2 day;
+----------------------------+
| curdate() - interval 2 day |
+----------------------------+
| 2002-02-28                 |
+----------------------------+
1 row in set (0.01 sec)

--
Roger
query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to