| Author: Karthikeyan S 30 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
Hi,
First in database have a column to store the lastvisiteddate column in user details table.
Then in the login page of your website in the page after successfull login, in the page load event and if (IsPostBack) is false then update the database field with current date using query ( UPDATE USER_DETAIL SET LastLoggedInDate = getdate() where ID = LOGGED_IN_ID;
There by loggedin userdetail, 'LastLoggedInDateTime' or 'PreviousVisitedDate' is get updated once user logged in your page successfully. )
Note: In my earlier post i told more details about IsPostBack.
|
| Author: pavani 30 Aug 2008 | Member Level: Bronze | Rating: Points: 0 |
thank u
|
| Author: satyam kumar 31 Aug 2008 | Member Level: Silver | Rating: Points: 5 |
Hi,
I am sure the User table would have date time column related to Previous visit date.
Now what you do in the time of login, retrieve the Previous Visit date and update the column respected to specific user.
Example:
select PreviousVisitDate from user where userID = 'Given UserID';
Update PreviousVisitDate = getdate() where userID = 'Given UserID';
Hope it will help you.
If you have concern please let me know.
Thanks: Satyam Kumar
|