"Aurelian Dumitru" <[EMAIL PROTECTED]> wrote:
> Please record the following bug identified on the MySQL server:
>
> 1. Hardware: SUN Ultra 10
> 2. Operating system: Sun Solaris 2.7
> 2. MySQL server version: 3.23.33
> 3. Error description:
> - The following SQL statement returns incorrect results when is
executed
> using the 'mysql' client: SELECT @myvar := ( CURRENT_DATE - 1) ;
> - I ran this query every day. It worked fine untill May 1st, 2001
I gues every day didn't include April 1, 2001 b/c that won't work either.
>, when the
> above query returned the following value: 20010500 . It should have
returned
> 20010430.
No, it returned the right value. current_date returns a date of the format
'2001-05-01'. When you do arithmetic on it, it's converted to an integer.
20010501 - 1 = 20010500 so it gave the currect value. If you want to
subtract one day from a date do this:
SELECT DATE_SUB( current_date, INTERVAL 1 DAY );
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
---------------------------------------------------------------------
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