Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> FW: Last Fridayof the month

FW: Last Fridayof the month

From: Toepke, Kevin M <ktoepke_at_cms.cendant.com>
Date: Tue, 23 Jan 2001 13:04:18 -0500
Message-Id: <10750.127306@fatcity.com>


Whoopse, sent the wrong version...it should have said: SELECT DECODE(TO_CHAR(LAST_DAY(SYSDATE), 'DAY')

             ,'FRIDAY', LAST_DAY(SYSDATE)
             ,NEXT_DAY(LAST_DAY(SYSDATE), 'FRIDAY') - 7)
from dual
/

-----Original Message-----
From: Toepke, Kevin M
Sent: Tuesday, January 23, 2001 12:47 PM To: 'ORACLE-L_at_fatcity.com'
Subject: RE: Last Fridayof the month

This should do it.

SELECT DECODE(TO_CHAR(LAST_DAY(SYSDATE), 'DAY')

             ,'FRIDAY', SYSDATE
             ,NEXT_DAY(LAST_DAY(SYSDATE), 'FRIDAY') - 7)
from dual
/

In brief, if the last day of the month is a Friday, return the last day of the month. If not, find the last day of the month, find the next Friday (first Friday of next month) and go back one week to get the last Friday of the month.

Kevin

-----Original Message-----
From: lerobe - Lee Robertson [mailto:LEROBE_at_acxiom.co.uk] Sent: Tuesday, January 23, 2001 11:26 AM To: Multiple recipients of list ORACLE-L Subject: Last Fridayof the month

All,  

Anyone know how I can select the last Friday in every month from dual. I just can't seem to figure this out. I am trying to test a job that needs to be submitted via dbms_job.isubmit on that day.    

TIA   Lee Robertson
Acxiom
Tel: 0191 525 7344
Fax: 0191 525 7007
Email: lerobe_at_acxiom.co.uk  

The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: lerobe - Lee Robertson
  INET: LEROBE_at_acxiom.co.uk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Tue Jan 23 2001 - 12:04:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US