List:General Discussion« Previous MessageNext Message »
From:Aldrian Gintingsuka Date:April 15 1999 11:06am
Subject:Re: Previous Days using CURADTE()
View as plain text  
select date_sub(curdate(), interval 16 day);
  1999-03-30

The function is available since MySQL 3.22.
Using curdate() in a numeric context will treat the output of curdate() as a
number (see manual).

========================================================================
Aldrian Gintingsuka -- Systems Consultant -- Mitra Integrasi Informatika
Phone: +62-21-251-1360 ext. 1414 -- Fax: +62-21-251-2748
Email: aldrian@stripped, aldrian@stripped
------------------------------------------------------------------------
Si tu es contre Dieu, tu es contre l'homme (Enigma: Sadeness part I)



On Thu, 15 Apr 1999, Alex Schajer wrote:

alex> When I:
alex> 
alex> SELECT CURDATE();
alex> 	1999-04-15 
alex> SELECT CURDATE()-1;
alex> 	19990414
alex> However when I:
alex> SELECT CURDATE()-16;
alex> 	19990399
alex> 
alex> The problem appears when the number of days being deducting from curdate is
alex> greater than the number of days in that month.
alex> 
alex> Is there a safe way of going back in time?
alex> 
alex> Thanks,
alex> 
alex> Alex Schajer
alex> 




Thread
Previous Days using CURADTE()Alex Schajer15 Apr
  • Re: Previous Days using CURADTE()Aldrian Gintingsuka15 Apr
Re: MySQL transaction problem (Again...)Carfield Yim11 Jan
  • Re: MySQL transaction problem (Again...)Tomi Junnila11 Jan
RE: MySQL transaction problem (Again...)Richard RE SSI-GRAX Mehalick11 Jan