Log in

View Full Version : Resolved find inactive users



ankush
03-24-2013, 07:05 PM
I am storing last login time of user in users table, I want to get all the users inactive from 10 days anyone help with the query.

james438
03-24-2013, 07:53 PM
Try this:


SELECT ID, date, name FROM users WHERE date > CURDATE()-10;

date in the query above is a column name. You can read more about MySQL time and date functions here (http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_curdate).