MS SQL 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:33 UTC
Read the original article
Hit count: 199
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. :)
© Stack Overflow or respective owner