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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Job to run first Wednesday

RE: Job to run first Wednesday

From: Kevin Toepke <ktoepke_at_rlcarriers.com>
Date: Tue, 22 Jul 2003 15:22:42 -0400
Message-Id: <25988.338960@fatcity.com>


or simply....

SELECT NEXT_DAY(ADD_MONTHS(TRUNC(to_date('31-dec-2002'), 'MM')-1, 1), 'WEDNESDAY')
FROM dual
/

-----Original Message-----
From: Jared.Still_at_radisys.com [mailto:Jared.Still_at_radisys.com] Sent: Tuesday, July 22, 2003 3:50 PM
To: Multiple recipients of list ORACLE-L Subject: Re: Job to run first Wednesday

Here's a bit of code that will always find the first wednesday of the following month:

alter session set nls_date_format = 'mm/dd/yyyy';

define testdate = '09/03/2003'

select

   trunc(add_months('&&testdate',1),'mm') +    decode( to_char(trunc(add_months('&&testdate',1),'mm'),'dy')

,'wed',0
,'thu',6
,'fri',5
,'sat',4
,'sun',3
,'mon',2
,'tue',1

   )
   --, to_char(trunc(add_months('&&testdate',1),'mm'),'dy') from dual
/

HTH Jared

PS. You're out by the airport, correct? I interviewed there once upon a time.

Josh Collier <Josh.Collier_at_Banfield.net> Sent by: ml-errors_at_fatcity.com
 07/22/2003 12:14 PM
 Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc: 
        Subject:        Job to run first Wednesday


Greetings,

How can I set the interval in my dbms job to have it run on the first Wednesday of every month? Is this even possible? I have been trying to noodle it thru for a week to no avail.

tia,

Josh

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Josh Collier
  INET: Josh.Collier_at_Banfield.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: Jared.Still_at_radisys.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Jul 22 2003 - 14:22:42 CDT

Original text of this message

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