programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
Programming FAQs

How to get year start date and end date in oracle

Average: 4.5 (8 votes)

using last_day, add_months

using last_day, add_months and trunc function we can calculate the year start/end date.

eg: to get the first day of the year

select trunc(sysdate, 'YYYY') from dual

eg: To get the last day of the year

select last_day(add_months(trunc(sysdate,'YYYY'), 11)) from dual

Combine above two queries u will get the start and end day of the year

select last_day(add_months(trunc(sysdate,'YYYY'), 11)) from dual