This function works similar to ROUND of numbers, if the month is geater than six (6) then return the day of next year else it returns day of current year.
SELECT ROUND (SYSDATE, 'YEAR') "As of day" FROM DUAL;
/
AS OF DAY
1/1/2021
SELECT ROUND (TO_DATE ('12-mar-2021'), 'YEAR') "Current Year" FROM DUAL;
/
CURRENT YEAR
1/1/2021
SELECT ROUND (TO_DATE ('12-aug-2021'), 'YEAR') "New Year" FROM DUAL;
/
NEW YEAR
1/1/2022
First and Last Day of the year
SELECT TRUNC (SYSDATE, 'YEAR') "First Day" FROM DUAL;
I am a seasoned developer with a passion for crafting robust solutions in the realm of Oracle Database and Oracle APEX. With over 10 years of experience under my belt,
* Oracle APEX
* APEX Themes and Plugins
* Oracle Database
* CSM & ASM