[thelist] Date calculations in MySQL

kris burford kris at midtempo.net
Wed Jan 21 06:51:09 CST 2004


>If I get today's date in a SQL statement in MySQL using Now(), how can I add
>an integer number of days to give me a new date occurring x days from the
>original?
>
>EG: INSERT INTO [table_name] ([date_field]) VALUES ([Now() + 30 days])

http://www.mysql.com/doc/en/Date_and_time_functions.html

this link was posted yesterday by Christopher Joseph - you're probably 
wanting the Add_date function.

don't know whether you can have curdate() as the first expression, have a 
play and see.

hth

kris
--
kris burford
midtempo ltd
http://www.midtempo.net



More information about the thelist mailing list