MS SQL Query Question
- by Lp1
Running MS SQL 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. Any help or a point in the right direction, and I would be eternally grateful. :)