From: Aldrian Gintingsuka Date: April 15 1999 11:06am Subject: Re: Previous Days using CURADTE() List-Archive: http://lists.mysql.com/mysql/1894 Message-Id: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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>