Jump to content


Photo

WHAT IS WRONG WITH THIS, HELP PLEASE


  • Please log in to reply
1 reply to this topic

#1 defcon2000

defcon2000
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 December 2005 - 11:23 PM

Hello,

Pls tell me what is wrong with my statement:

UPDATE reminder
set reminderdate = (IF (status = 'Open' and reminded = 'Y'
and autoclose = 'Y' and recur = 'Y',
ADDDATE(reminderdate, INTERVAL occurence occurencetype), reminderdate))

occurencetype can be "DAY", "MONTH" or "YEAR" and stored as a VARCHAR.
occurenace can be any value such as 1, 2, 5, 12, 10, etc ... and is an INT.

Thanks for your help.

Rgds,

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 24 December 2005 - 01:08 AM

The date function is called DATE_ADD(), not ADDDATE() -- this should resolve your syntax error, assuming everything else is OK.

Hope that helps.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users