Thursday, August 24, 2017

year month days

select join_dt, sysdate         ,trunc(months_between(sysdate, join_dt) / 12) as yrs
         ,trunc(mod(months_between(sysdate, join_dt), 12)) as mnths
        ,trunc(sysdate - add_months(join_dt, trunc(months_between(sysdate, join_dt)))) as dys from emp_mast where emp_id='010001'

 JOIN_DT   SYSDATE          YRS      MNTHS        DYS
--------- --------- ---------- ---------- ----------
01-NOV-10 24-AUG-17          6          9         23

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...