Get current year :
SELECT TO_CHAR(SYSDATE, 'YYYY') AS Current_Year FROM DUAL;
First Day of Current Year:
SELECT TO_CHAR(TRUNC (SYSDATE , 'YEAR') ,'DD/MM/YYYY') FROM DUAL;
Last Day of Current Year:
SELECT TO_CHAR(ADD_MONTHS(TRUNC (SYSDATE ,'YEAR'),12)-1,'DD/MM/YYYY')
AS LastDay_Current_Year
FROM DUAL;
First Day of Previous Year:
SELECT TO_CHAR(ADD_MONTHS (TRUNC (SYSDATE,'YEAR'), -12),'DD/MM/YYYY')
AS FirstDay_Previous_Year
FROM DUAL;
Last Day of Previous Year:
SELECT TO_CHAR(ADD_MONTHS (TRUNC (SYSDATE, 'YEAR'), -1 ) +30 ,'DD/MM/YYYY')
AS LastDay_PreviousYear
FROM DUAL;
Comments
Post a Comment