Archive for January, 2013
ORACLE : How to Show / Get, Year Month and Date between two date ?
January 28th, 2013, posted in Oracle QueriesUse bellow sql to show year month and date :
SELECTÂ Â Â TRUNC (MONTHS_BETWEEN (:END_DATE, :START_DATE) / 12) as YEARS,
MOD(TRUNC (MONTHS_BETWEEN (:END_DATE, :START_DATE)), 12) as MONTHS,
(Â TO_DATE (:END_DATE)- ADD_MONTHS (:START_DATE,TRUNC (MONTHS_BETWEEN (:END_DATE, :START_DATE))))Â as Date
FROM DUAL;
********************************************************************************************************************* Note : Please not do make backups before using these queries and also confirm them yourself or by aother means as well. *********************************************************************************************************************