Hi,

The task is to find users whose accounts have not been validated for the
last 10 days.  This SELECT accomplishes that:

SELECT * FROM user WHERE validated LIKE 'N' AND dateCreated <=
DATE_SUB(CURDATE(), INTERVAL 10 DAY)

But, using curdate() is dangerous.  What if the system time is messed
up?  Instead, would be better to use MAX(dateCreated), but that does not
work.

This does not work:
SELECT * FROM user WHERE validated LIKE 'N' AND dateCreated <= 
DATE_SUB(MAX(dateCreated), INTERVAL 10 DAY)
Error is 'Invalid use of group function " even if a GROUP BY is added.

Is there a way to do this, so that the SELECT can get only values for
users who have validated LIKE 'N' and their dateCreated is 10 days
before the latest dateCreated?

Thanks for your help.
Jim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to