v number(10,4);
begin
v:=24*(to_date(p_delivery_time , 'DD-MON-RR HH24:MI:SS') - to_date(p_booking_time, 'DD-MON-RR HH24:MI:SS'));
return(v);
end;
/
select f_delivery_time('20-SEP-18 15:10:10','20-SEP-18 14:10:10') from dual;
1
EXEC DBMS_OUTPUT.PUT_LINE(f_delivery_time('20-SEP-18 15:10:10','20-SEP-18 14:10:10'));
1
/*
select end_date,start_date,
trunc(months_between(end_date,start_date)/12) as yrs ,
trunc(mod( months_between(end_date,start_date) ,12)) as mnts,
trunc(end_date - add_months( start_date, months_between(end_date,start_date))) as dys,
trunc(24*mod(end_date - start_date,1)) as hrs,
trunc( mod(mod(end_date - start_date,1)*24,1)*60 ) as mins ,
mod(mod(mod(end_date - start_date,1)*24,1)*60,1)*60 as secs
from ( select to_date('15/11/2015 11:19:58','dd/mm/yyyy hh24:mi:ss') end_date ,
to_date('14/10/2014 10:18:57','dd/mm/yyyy hh24:mi:ss') start_date
from dual );
No comments:
Post a Comment