Lester Wilson
10-27-2015, 05:31 AM
Hello, I'm looking for some help with a query.
I have a number of user accounts that I would like to move to a new user group. The accounts belong to users that have registered, but have never revisited the forum.
I'd like to move all users with ZERO posts whos REGISTRED Date and LAST VISIT Date are on the same day where registration took place more than 60 days ago.
Could someone suggest a query that will achieve this?
Thank you.
--------------- Added 1445928127 at 1445928127 ---------------
Just after posting i came up with this. Seems to work for me........Maybe useful to others?
Move users to another user group who’s last activity and join date are within 24 hours and have no posts.
UPDATE user
SET usergroupid= <--- user group id goes here
WHERE lastactivity - joindate < 86400 < --- 24 hrs
and posts = 0; <--- they never posted
I have a number of user accounts that I would like to move to a new user group. The accounts belong to users that have registered, but have never revisited the forum.
I'd like to move all users with ZERO posts whos REGISTRED Date and LAST VISIT Date are on the same day where registration took place more than 60 days ago.
Could someone suggest a query that will achieve this?
Thank you.
--------------- Added 1445928127 at 1445928127 ---------------
Just after posting i came up with this. Seems to work for me........Maybe useful to others?
Move users to another user group who’s last activity and join date are within 24 hours and have no posts.
UPDATE user
SET usergroupid= <--- user group id goes here
WHERE lastactivity - joindate < 86400 < --- 24 hrs
and posts = 0; <--- they never posted