Tuesday, April 18, 2017

YEARS MONTHS DAYS

 SELECT   TRUNC (MONTHS_BETWEEN ('10-JAN-17', '30-JUN-17') / 12)  YEARS,
    MOD (TRUNC (MONTHS_BETWEEN ('10-JAN-17', '30-JUN-17')), 12)  MONTHS,
    TO_DATE ('10-JAN-17')- ADD_MONTHS ( '30-JUN-17',TRUNC (MONTHS_BETWEEN ('10-JAN-17', '30-JUN-17')) ) DAYS
       FROM DUAL;


     YEARS     MONTHS       DAYS
---------- ---------- ----------
         0         -5        -21

No comments:

Post a Comment

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...