Code Listing 2: Find the last Saturday of a given month.

SQL> select next_day(
  2              last_day( to_date( '&YOUR_MONTH', 'MM' ))-7,
  3                 to_char( to_date( '29-01-1927', 'dd-mm-yyyy' ), 'DAY' )
  4       )
  5   from dual;

Enter value for your_month: 01
old   2:             last_day( to_date( '&YOUR_MONTH', 'MM' ))-7,
new   2:             last_day( to_date( '01', 'MM' ))-7,
 
NEXT_DAY(
----------
31-JAN-04

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy