At 11:03 +1100 12/4/02, Chris Kay wrote:
How would I go about grabbing all records where a field is older than 21
days and set to a certain status.
Dunno what you mean by "set to a certain status", but the other part will
be:

WHERE datetime_field < DATE_SUB(NOW(),INTERVAL 21 DAY)

I tried INTERVIAL 21 Day but I cant seem to get it to work
Seems like you were on the right track, but you don't show your
actual query, so we can't comment on it.

Field in the database is datetime

Am I doing something wrong? Or is there a easier way to do this, would
someone mind giving me a example query where I would add 21 days to a
datetime field


Mysql, query
---------------------------------------------------------
Chris Kay (Systems Development)
Techex Communications
Website: www.techex.com.au Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to