SQL Server Query Question

Posted by Lp1 on Stack Overflow See other posts from Stack Overflow or by Lp1
Published on 2010-04-26T04:24:02Z Indexed on 2010/04/26 4:53 UTC
Read the original article Hit count: 254

Filed under:
|
|

Running SQL Server 2008, and I am definitely a new SQL user.

I have a table that has 4 columns:

EmpNum, User, Action, Updatetime

A user logs into, and out of a system, it is registered in the database. For example, if user1 logs into the system, then out 5 minutes later, a simple query (select * from update) would look like:

EmpNum   User    Action   Updatetime
1        User1   I        2010-01-01 23:00:00:000
1        User1   O        2010-01-01 23:05:00:000

I'm trying to query the Empnum, User, Action, I(in time), O(out time), and the total time.

© Stack Overflow or respective owner

Related posts about sql

Related posts about query