–> First Day of Current Year:
SELECT TRUNC (SYSDATE , ‘YEAR’) FROM DUAL;
–> Last Day of Current Year:
SELECT ADD_MONTHS(TRUNC (SYSDATE ,’YEAR’),12)-1 FROM DUAL;
–> First Day of Previous Year:
SELECT ADD_MONTHS (TRUNC (SYSDATE,’YEAR’), -12) FROM DUAL;
–> Last Day of Previous Year:
SELECT ADD_MONTHS (TRUNC (SYSDATE, ‘YEAR’), -1 ) +30 FROM DUAL;
SELECT TRUNC (SYSDATE , ‘YEAR’) FROM DUAL;
–> Last Day of Current Year:
SELECT ADD_MONTHS(TRUNC (SYSDATE ,’YEAR’),12)-1 FROM DUAL;
–> First Day of Previous Year:
SELECT ADD_MONTHS (TRUNC (SYSDATE,’YEAR’), -12) FROM DUAL;
–> Last Day of Previous Year:
SELECT ADD_MONTHS (TRUNC (SYSDATE, ‘YEAR’), -1 ) +30 FROM DUAL;
No comments:
Post a Comment
Note: only a member of this blog may post a comment.