SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

pch
Starting Member

USA
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


pc

tkizer
Almighty SQL Goddess

USA
36851 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
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

slimt_slimt
Aged Yak Warrior

Switzerland
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  
 New 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.08 seconds. Powered By: Snitz Forums 2000