Hi All,

I need query help for following table struture, where we need to calculate 
login duration of that employee for give period.

Example table


EmployeeID     LoginTime                       LogoutTIme

101                 2012-05-01 10:00:00     2012-05-01 12:30:00
102                 2012-04-31 23:00:00      2012-05-02 05:00:00  

103                 2012-05-01 14:00:00      NULL    
104                 2012-05-02 00:10:00      2012-05-02 05:00:00


I tried to fit all scenario in above table, Consider NULL as yet to logout


How would i calcuate Employee and it Login duration for period say from 
2012-05-01 08:00:00 to 2012-05-01 22:00:00


--Anupam

Reply via email to