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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 login logout reoport

Author  Topic 

vipinjha123
Starting Member

45 Posts

Posted - 2012-05-21 : 06:32:55
Dear All,

i am looking for a query wheren i can find the exact number of employee who is currently working in office



suppose at 8am 20 person login and at same time 2 person gets log out ao i should get numbner of em,ployee at 8 am is 18

i am looking for this rteport as hourly basis

my table is login(empid,logintime,logouttime,location)

please help me as this is very important for me,



thankx regards,

Vipin jha

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-21 : 16:44:34
what will be logouttime value for people who are currently logged in? will it be NULL or some default value?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vipinjha123
Starting Member

45 Posts

Posted - 2012-05-22 : 01:20:46
the logout time will be again the combination of datetime
what i am looking for every hour some person login and same time some person logout so i need a output like
sum of all employee who are currently in office on hourly basis.
suppose at 8am 20 peson login and at the same time 5 person logout so my count wil be 15 at 8am. means at 8 am 8 people are currently in office.
i am looking for result like
countofemp hour
15 8
23 9

regards,
Vipin jha
Go to Top of Page
   

- Advertisement -