Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon and Logoff for the same User\Computer\Location on 1 Record

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
0
0
US
I have a table and here is an example of what is in the table. I had a query and I accidently deleted it and now I can't remember how I did it. I'm sure I was given the great query in this forum or another forum but can't find it. The only thing I remember about the select statement query is that I had this table in the query three times.

"lab_usage" table

id computer user operation location created_at
1 Bldg_Lab1_22 001 logon Bldg_1 2010-03-17 15:57:40
2 Bldg_Lab1_19 555 logon Bldg_1 2010-03-17 15:59:42
3 Bldg_Lab1_20 658 logon Bldg_1 2010-03-17 16:02:27
4 Bldg_Lab1_20 658 logoff Bldg_1 2010-03-17 16:09:10
5 Bldg_Lab1_19 555 logoff Bldg_1 2010-03-17 16:10:13
6 Bldg_Lab1_22 001 logoff Bldg_1 2010-03-17 16:24:32
7 Bldg_Lab2_08 854 logon Bldg_2 2010-03-17 16:50:20
8 Bldg_Lab2_08 854 logoff Bldg_2 2010-03-17 19:20:13

id 1 (id is an auto incremented field) is the logon for user 001 and id 6 is the logoff for the same user so:

user computer location operation created_at operation created_at
001 Bldg_Lab1_22 Bldg_1 logon 2010-03-17 15:57:40 logoff 2010-03-17 16:24:32

id 2 is the logon for user 555 and id 5 is the logoff for the same user so:

user computer location operation created_at operation created_at
555 Bldg_Lab1_19 Bldg_1 logon 2010-03-17 15:59:42 logoff 2010-03-17 16:10:13
and so on

I have data from March 2010 to the end of the 2010 year in the table.

Help is appreciated.
 
I did a search on my computer and found a txt file of it. Yippee!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top