Calculating the Number of Days of Summer in June : LAST_DAY « Date Timestamp Functions « Oracle PL/SQL Tutorial






SQL> SELECT LAST_DAY('20-JUN-99') "Last_Day",
  2            LAST_DAY('20-JUN-99') - TO_DATE('20-JUN-99') "Days_Summer"
  3       from DUAL;

Last_Day  Days_Summer
--------- -----------
30-JUN-99          10

SQL>








13.8.LAST_DAY
13.8.1.The LAST_DAY function returns the last day of any month
13.8.2.SELECT LAST_DAY('01-JAN-2005') FROM dual;
13.8.3.Finding the Last Day of the Month Starting Summer
13.8.4.Calculating the Number of Days of Summer in June
13.8.5.LAST_DAY(column value)+1
13.8.6.Combine LAST_DAY and ADD_MONTHS together