select OGP_CREATED,OGP_NO,ACCOUNT_NAME,IGP_NO,TIMEPASS,
numtodsinterval((SUBSTR(TIMEPASS,1,INSTR(TIMEPASS,'-')-1)*60 + (REGEXP_SUBSTR(TIMEPASS, '[^-]+$'))), 'minute')Days_Hours_minutes
FROM
(
select to_char(a.CREATEDDATE,'DD-MON-YYYY hh24:mi:ss')ogp_created,a.ogp_no,a.accid,name_of.account(a.accid)ACCOUNT_NAME , b.igp_no ,
time_of.hours_minutes( time_of.get_time_diff_in_seconds(sysdate, a.CREATEDDATE )) timepass,
(sysdate)-(a.CREATEDDATE)AGING_DAYS
from inv_ogp_m a, inv_igp_m b
where a.unit_id = 1
and a.ogp_date between :frmdat and :toodat
and a.accid in (select distinct accode from account where ACCOUNT_TYPE = 'Internal')
and a.ogp_no = b.ogp_no (+)
and b.igp_no is null
)
No comments:
Post a Comment