/*Calculate Average Oracle Concurrent Program Completed Time*/
select avg(fr1.actual_completion_date - fr1.actual_start_date) avgCPtime
from fnd_concurrent_requests fr1
, fnd_concurrent_requests fr2
where fr2.request_id = NVL(:P_request_ID, fr2.request_id)
and fr1.concurrent_program_id = fr2.concurrent_program_id
and fr1.program_application_id = fr2.program_application_id
and fr1.actual_start_date is not null
and fr1.actual_completion_date is not null;