From: Peter Brawley Date: November 30 2005 9:48pm Subject: Re: Date increment List-Archive: http://lists.mysql.com/mysql/192360 Message-Id: <438E1E1D.7060508@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-438E1E1E04DC=======" --=======AVGMAIL-438E1E1E04DC======= Content-Type: multipart/alternative; boundary=------------010607000800020508070104 --------------010607000800020508070104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Peter >Is there any function in MySQL that adds days to a date? See ADDDATE(...) at http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html. PB ----- Peter Lauri wrote: > Best group member, > > > > I have a field called expiredate of type 'date'. I would like to add > 17 days to the expiredate without doing any scripting, is that possible? > > > > Example: > > Expiredate is 2005-11-30 and I want to extend the expiredate with 17 > days. Is there any function in MySQL that adds days to a date? > > > > A solution for this would be to write a PHP script that takes the date > and adds 17 days to it (checking month overlap and stuff), but I want > to skip scripting if there is an solution within MySQL that does it > for me. > > > > /Peter > > > >------------------------------------------------------------------------ > > > > >------------------------------------------------------------------------ > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 11/30/2005 > > > --------------010607000800020508070104 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Peter

>Is there any function in MySQL that adds days to a date?

See ADDDATE(...) at http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html.

PB

-----

Peter Lauri wrote:

Best group member,

 

I have a field called expiredate of type ‘date’. I would like to add 17 days to the expiredate without doing any scripting, is that possible?

 

Example:

Expiredate is 2005-11-30 and I want to extend the expiredate with 17 days. Is there any function in MySQL that adds days to a date?

 

A solution for this would be to write a PHP script that takes the date and adds 17 days to it (checking month overlap and stuff), but I want to skip scripting if there is an solution within MySQL that does it for me.

 

/Peter

 



No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 11/30/2005
--------------010607000800020508070104-- --=======AVGMAIL-438E1E1E04DC======= Content-Type: text/plain; x-avg=cert; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: "AVG certification" No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 11/30/2005 = --=======AVGMAIL-438E1E1E04DC=======--