scottyjohn
Technical User
Hi all,
I have an oracle viewas per below....
It will display two records with the same employee_id and the same date, which will be a login event and a logout event. What I need to do is to have a query which will display the employee_id, the date, and the total time between the login event and the logout event. I cant think how to do this, so any help or advice would be much appreciated....
John
I have an oracle viewas per below....
Code:
CREATE OR REPLACE VIEW v_login (
employee_id,
place,
event_desc,
eventdate,
"TIME"
) AS
SELECT
P.EMPLOYEE_ID,
L.NAME,
CASE STATUS
WHEN 0 THEN 'LOGOUT'
WHEN 1 THEN 'LOGIN'
ELSE 'Unknown' END,
TO_CHAR(TO_DATE('01.01.70','DD.MM.RR')+(TIME/(60*60*24)),'DD/MM/YYYY'),
TO_CHAR(TO_DATE('01.01.70','DD.MM.RR')+(TIME/(60*60*24)),'HH24:MI:SS')
FROM
CONFIG02.CFG_PERSON P,
SOFTPHONE.LOGIN S,
CONFIG02.CFG_PLACE L
WHERE P.DBID = S.AGENTDBID AND S.PLACEDBID = L.DBID
AND QUEUEDBID ='0'
/
It will display two records with the same employee_id and the same date, which will be a login event and a logout event. What I need to do is to have a query which will display the employee_id, the date, and the total time between the login event and the logout event. I cant think how to do this, so any help or advice would be much appreciated....
John