Originally posted by Anand Bhatt: I have tried this function,but unfortunately getting this error: ADDDATE('2004-1-10', INTERVAL 7 DAY)

I would like to mention that I am using MySQl5.0

Try this... I believe it is because you used '1' instead of '01' for your month... but to be sure you should probably make sure that the database engine knows your date and its format by using to_date in the function.

ADDDATE(TO_DATE('2004-01-10','YYYY-MM-DD'), INTERVAL 7 DAY)

Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338

posted Dec 11, 2008 07:25:00

0

Originally posted by Anand Bhatt: Thanks, now I get the desired result. Thanks a lot Paul.

Good... I was going off of memory... I don't use MySQL that much here.