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

Home -> Community -> Usenet -> c.d.o.misc -> Re: this cannot be then best way

Re: this cannot be then best way

From: <akkha1234_at_gmail.com>
Date: 14 Jul 2006 11:47:42 -0700
Message-ID: <1152902862.110037.57860@s13g2000cwa.googlegroups.com>


What if you have some holiday in between?

Ed Prochak wrote:
> g wrote:
> > I have a date mydate and i want to subtract X working days off
> >
> > i was thinking of something like
> >
> > loop while x > 0
> > if to_char(mydate,'d') < 6 then
> > x = x -1
> > endif
> > mydate :mydate - 1
> > endloop
> >
> > any ideas
>
> If X tends to be large (>2weeks),
> then save a few passes thru the loop by
>
> --- computing the whole weeks
> whole_weeks := ( 7* (X/5) ) --- must use integer arithmetic
> mydate := mydate - whole_weeks
> x := mod(x,5)
> --- then put your loop here:
>
>
> HTH,
> ed
Received on Fri Jul 14 2006 - 13:47:42 CDT

Original text of this message

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