Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: NEXT BUSINESS DAY
YOu could wite a couple of PL/SQL functions...here is some skeleton code.
one to test for Saturday and SUnday and another to check for holidays.
DECLARE vNextBizDay DATE
vNextBizDay := sysdate + 1
Pass vNextBizDay to a SatSun Function test
-----SatSun Function
test VNextBizDay and find out if it a saturday using to_char
if it is a saturday add two days anything else add one Return date
------End
next
Then use a look up table and enter your offical holidays in it. Check the variable for any dates that match your holiday list and run it through the test above...remeber to use to_char to make easy comparisons....might be other glitches with making sure the varibale stays a date. But you can figure that out.
------Holiday Test Function
Select Holiday from HOLIDAY_TABLE where Holiday_dt = vNextBizDay
IF %SQLNOTFOUND THEN Return vNextBizDay Else vNextBizDay := vNextBizDay + 1 do the SatSun Function test Return vNextBizDay End if
------End
Snap! your done....
-----Original Message-----
Sent: Tuesday, October 07, 2003 1:29 PM
To: Multiple recipients of list ORACLE-L
List,
any body know any module or reference to get the next business day including
holidays etc.
Thanks,
Hamid Alavi
Office : 818-737-0526
Cell phone : 818-416-5095
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Hamid Alavi
INET: hamid.alavi_at_quovadx.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 also send the HELP command for other information (like subscribing).
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). Received on Tue Oct 07 2003 - 13:59:26 CDT
![]() |
![]() |