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

 All Forums
 General SQL Server Forums
 Script Library
 login logout time calculation - sql

Author  Topic 

pch
Starting Member

1 Post

Posted - 2010-08-21 : 19:24:01
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


pc

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-21 : 20:53:39
You can use the SUM function along with GROUP BY for each day.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-22 : 13:21:43
post DDL of your table and we will provide you with query.
Go to Top of Page
   

- Advertisement -