Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: weekends/holidays
Lyuda,
For weekends, you can check to_char('&date', 'D'). The 'D' format returns the day of the week. A 1 or a 7 would indicate Sunday or Saturday. For holidays, you'd have to write your own function. You could set up a table of legal holiday dates, that you would have to populate. Truth be told, there are lots of holidays, some more observed than others. So you'd really have to define for yourself which holidays count and which don't.
Then write a function is_holiday to return true if a specific date is found in the holidays table, or false if its not.
hth,
Yosi
lhoska_at_calibresys.com wrote:
> Hi list,
> Is there a function in Oracle that will determine if particular calendar day
> is weekend or a US holiday. I need to write a function that will check the
> data integrity of my db. It will check data entered into the system and
> notice any gaps. I have to go by days(i.e. every day there should be an
> entry/ies unless it is a weekend or holiday.)
> Thank you in advance,
>
> Lyuda Hoska
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Yosi Greenfield INET: yosi_at_comhill.com 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 also send the HELP command for other information (like subscribing).Received on Fri Oct 05 2001 - 12:20:46 CDT
![]() |
![]() |