LAST_DAY : Date Functions « PL SQL Data Types « Oracle PL/SQL Tutorial






The LAST_DAY function retrieves the last day of the month in the specified date.

v_dt:= LAST_DAY (date);
SQL>
SQL> declare
  2      v_dt DATE;
  3      v_form_tx  VARCHAR2(25):=
  4                 'DD-MON-YYYY HH24:MI:SS';
  5  begin
  6      v_dt:=last_day(sysdate);
  7      DBMS_OUTPUT.put_line(to_char(v_dt,v_form_tx));
  8  end;
  9  /
30-JUN-2007 20:32:45

PL/SQL procedure successfully completed.

SQL>








21.10.Date Functions
21.10.1.Working with dates and built-in functions EXTRACT
21.10.2.TRUNC and ROUND
21.10.3.ROUND
21.10.4.ADD_MONTHS
21.10.5.LAST_DAY
21.10.6.MONTHS_BETWEEN
21.10.7.Use TRUNC to get only the time
21.10.8.Returning a point just before a specific midnight with TRUNC
21.10.9.TO_DATE('29-DEC-1988','dd-mon-yyyy')