How to find out which members have not logged-in within the past year?
Posted on 2013-07-01
I am trying to clean up our membership database.
I have two tables. A membership table called 'members' which houses all membership information, and a logins table called "logins" which tracks each successful log-in.
I'd like to be able to join the two tables and find the member records for those users that have not logged in within the last calendar year.
Note: The 'LoginDate' field is a current_timestamp field.
SELECT *.members FROM members JOIN logins ON members.NUID=logins.NUID WHERE logins.LoginDate > OneYear AND logins.LoginDate !< OneYear
I appreciate your help.