[thelist] [MySQL] date_add

Paul Bennett Paul.Bennett at wcc.govt.nz
Wed May 23 21:08:55 CDT 2007


> "SELECT StartDate + INTERVAL 1 MONTH from petition;"
Nope - PHPMyAdmin gives me error code 1064 and nothing else. I don't have access to the mysql command line unfortunately.

> "SELECT StartDate from petition;"?
Works fine

> "SELECT (StartDate + INTERVAL 1 MONTH) as one_month_later from petition;"
Error code 1064...

> Is the failure different if StartDate is populated versus being zero?
Here are the current values for StartDate:

	2007-05-01 14:57:29
	2007-04-01 14:53:02
	2007-05-10 12:22:30
	2007-05-11 14:01:11
	2007-04-21 08:41:30
	2006-05-14 17:35:26
	2007-01-01 10:46:25
	2007-05-22 08:55:17
	2007-05-22 09:50:23

What I'm trying to avoid is having to grab all the StartDates and Durations and use PHP to figure out if they have expired or not, but it looks like I'm gonna have to 'suck it up' and do it that way anyhow...



More information about the thelist mailing list