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

Home -> Community -> Usenet -> c.d.o.server -> Re: DATE Format: iw vs. ww for returning week

Re: DATE Format: iw vs. ww for returning week

From: Dag Arne Matre <dam_at_visma.no>
Date: Thu, 05 Oct 2000 10:24:37 GMT
Message-ID: <FFYC5.5145$Uc.551854@juliett.dax.net>

<oratune_at_aol.com> wrote in message news:8rbndc$v1s$1_at_nnrp1.deja.com...
> In article <37f68e9b.25271388_at_news.earthlink.net>,
> andreyNSPAM_at_bookexchange.net wrote:
> > OK,
> > I've been trying to find docs on this, and wasn't able to.
> > iw seems to be the ISO standard for weeks
> > ww seems to be an Oracle standard for weeks
> > iw would sometimes return 53 for Jan 1st
> > one would start thinking that iw returns week assuming that a new week
> > starts on monday, but it returns week one when Jan 1st falls on a thur
> > (1998)... anyway, I can't figure it out, does anybody know how these
> > 'formats' calculate week #?
> >
> > Thanx.
> >
>
> Oracle documentation states that for WW week 1 is from the first to the
> seventh day of the year. All subsequent weeks are calculated from this
> reference point. Also, according to the Oracle documentation for IW,
> the result can be either 52 or 53 weeks for the year; I presume that
> should there be roughly half a week or better left at the end of the
> year it becomes week 53.
>
> --
> David Fitzjarrell
> Oracle Certified DBA
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Some basic rules for calculating the ISO week no.: * The ISO week starts on Monday and ends on Sunday. * All days (Mon thru Sun) are always in the same week. Dec 31 and Jan 1 next year are in the same week unless Jan 1 is a Monday. * The week belongs to the year with (4 or) more days, which means that if Jan 1 is a Mon, Tue, Wed, or Thu the whole week is week 1/"next year", otherwise it is week 52(53)/"last year".

7*52=364 and there is 365(366) days in a year, so there are 53 weeks in a year every 5 or 6 year.

HTH,
D A Received on Thu Oct 05 2000 - 05:24:37 CDT

Original text of this message

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