Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 login logout time calculation - sql
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 08/21/2010 :  19:24:01  Show Profile  Reply with Quote
I am storing login and logout time in table. If a user logged in -- logged out, again logged in and logged out ( multiple times on the same day), how can I calculate the individual time as well as total time
I shall highly appreciate if you please help me.
Thank you in advance for your help


Almighty SQL Goddess

38200 Posts

Posted - 08/21/2010 :  20:53:39  Show Profile  Visit tkizer's Homepage  Reply with Quote
You can use the SUM function along with GROUP BY for each day.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server

Subscribe to my blog
Go to Top of Page

Aged Yak Warrior

746 Posts

Posted - 08/22/2010 :  13:21:43  Show Profile  Reply with Quote
post DDL of your table and we will provide you with query.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000