I have a log file as shown in the table. Every time the user logs in, his details are updated in this database.
I want to select the previous ActivityDate of that particular user when ever he logs in.
For example, in the Table Tom logs in on Aug 9 2015, I want to show the last sign in (ActivityDate) of Tom which is Aug 3 2015. The table gets updated whenever a user logs in. Can any one help how to get the info ?
UserID UserName Activity ActivityDate
1001 Bill SignIn Aug 1 2015
1002 Tom SignIn Aug 3 2015
1003 John SignIn Aug 3 2015
1001 Bill SignIn Aug 4 2015
1001 Bill SignIn Aug 6 2015
1002 Tom SignIn Aug 9 2015