K
krle
Hi,
I have table name "tblTimeLog" with following field names:
TRID
DEPT
CARDNO
NAME
LOGDATE
LOGTIME
ACTION
Data in table show this way:
TRID DEPT CARDNO NAME LOGDATE LOGTIME ACTION
1 Admin 100 Tom 07.05.2009 8:40:12 AM 1
2 Admin 100 Tom 07.05.2009 5:05:30 PM 2
3 Sales 200 Helen 08.05.2009 8:46:29 AM 1
4 Sales 200 Helen 08.05.2009 1:56:58 PM 2
5 Sales 300 John 04.05.2009 9:33:54 AM 1
6 Sales 300 John 04.05.2009 8:38:10 PM 2
7 CA 400 Julia 04.05.2009 10:57:53 PM 2
8 CC 500 Peter 05.05.2009 3:55:04 PM 1
9 CC 500 Peter 05.05.2009 10:01:42 PM 1
Where action number 1 is Entrance and 2 is Exit.
I need to create new table that will have look this way:
DEPT CARDNO NAME LOGDATE IN OUT
Admin 100 Tom 07.05.2009 8:40:12 AM 5:05:30 PM
Sales 200 Helen 08.05.2009 8:46:29 AM 1:56:58 PM
Sales 300 John 04.05.2009 9:33:54 AM 8:38:10 PM
CA 400 Julia 04.05.2009 10:57:53 PM
CC 500 Peter 05.05.2009 3:55:04 PM
CC 500 Peter 05.05.2009 10:01:42 PM
Empty fields are ok if there is no data according action.
Please help.
I have table name "tblTimeLog" with following field names:
TRID
DEPT
CARDNO
NAME
LOGDATE
LOGTIME
ACTION
Data in table show this way:
TRID DEPT CARDNO NAME LOGDATE LOGTIME ACTION
1 Admin 100 Tom 07.05.2009 8:40:12 AM 1
2 Admin 100 Tom 07.05.2009 5:05:30 PM 2
3 Sales 200 Helen 08.05.2009 8:46:29 AM 1
4 Sales 200 Helen 08.05.2009 1:56:58 PM 2
5 Sales 300 John 04.05.2009 9:33:54 AM 1
6 Sales 300 John 04.05.2009 8:38:10 PM 2
7 CA 400 Julia 04.05.2009 10:57:53 PM 2
8 CC 500 Peter 05.05.2009 3:55:04 PM 1
9 CC 500 Peter 05.05.2009 10:01:42 PM 1
Where action number 1 is Entrance and 2 is Exit.
I need to create new table that will have look this way:
DEPT CARDNO NAME LOGDATE IN OUT
Admin 100 Tom 07.05.2009 8:40:12 AM 5:05:30 PM
Sales 200 Helen 08.05.2009 8:46:29 AM 1:56:58 PM
Sales 300 John 04.05.2009 9:33:54 AM 8:38:10 PM
CA 400 Julia 04.05.2009 10:57:53 PM
CC 500 Peter 05.05.2009 3:55:04 PM
CC 500 Peter 05.05.2009 10:01:42 PM
Empty fields are ok if there is no data according action.
Please help.