Query to ESS request completion time and its status

SELECT
   erh.requestid ,
   NVL(erh.name, substr(erh.DEFINITION, instr(erh.DEFINITION, '/', - 1) + 1, LENGTH(erh.DEFINITION))) job_name,
   flv.MEANING request_state,
   TO_CHAR(erh.processstart, 'DD-MM-YYYY HH24:MI:SS') START_DATE,
   TO_CHAR(erh.processend, 'DD-MM-YYYY HH24:MI:SS') END_DATE,
   (
      erh.processend - erh.processstart 
   )
  time_took_so_far,
   erh.username
 
FROM
   ess_request_history erh,
   fnd_lookup_values flv
WHERE
   1=1
   AND sysdate BETWEEN nvl(flv.start_date_active, sysdate) AND nvl(flv.end_date_active, sysdate) 
   AND flv.lookup_type = 'ORA_EGP_ESS_REQUEST_STATUS' 
   AND flv.lookup_code = erh.state 
   and flv.language='US'
   AND erh.processend is not null 
AND ROWNUM < 100
ORDER BY
erh.requestid desc 

Leave a Reply

Your email address will not be published.