This content has been marked as final.
Show 1 reply
-
1. Re: Query help
-==cfSearching==- Nov 7, 2011 9:53 AM (in response to wmkolcz)The date compare is pretty easy but i have no idea on how to pull just
the top record of each person in the table.
Use MAX to get the last login date by username. Then wrap it up as a derived table so you can filter out the max dates that are one month ago or more.
Note: Replying via email so this may get mangled...
SELECT u.UserName, u.LastLogin
FROM (
SELECT UserName, MAX(lastAdded) AS LastLogin
FROM YourTable
GROUP BY UserName
) u
WHERE u.LastLogin <= #dateOneMonthAgo#


