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: To_char ('IW') format element

Re: To_char ('IW') format element

From: Randy Harris <randy_at_SpamFree.com>
Date: Thu, 20 Jan 2005 01:14:29 GMT
Message-ID: <VBDHd.17145$_X7.15473@newssvr33.news.prodigy.com>


"DA Morgan" <damorgan_at_x.washington.edu> wrote in message news:41ef039c$1_2_at_127.0.0.1...
> Randy Harris wrote:
>
> > "Randy Harris" <randy_at_SpamFree.com> wrote in message
> > news:LWBHd.11135$Vj3.736_at_newssvr17.news.prodigy.com...
> >
> >>I'm looking for clarification of the 'IW' format element. The docs say
it
> >>is based on the ISO standard, but I haven't been able to find further
> >>information. It's rather obvious if Jan falls on a Monday, week 1
begins
> >>the same day. But, what if Jan 1 falls on a Tuesday? Does week 1 begin
> >>that day, or the following Monday?
> >
> >
> > I'm finding it tough to figure this out by trial and error. It is
looking
> > as though week 1 always begins on Jan 1 and week 2 begins the following
> > Monday - except - if Jan 1 is a Friday, Saturday or Sunday, then week 1
> > doesn't begin until the following Monday and week 2 begins on the second
> > Monday.
> >
> > Can anyone confirm that this is correct?
>
> With ISO there can be a 53rd week in a year.
>
> SELECT TO_CHAR(sysdate-19, 'IW') FROM dual;
>
> written on the 19th of January, 2005.

Ya, I had seen that this happened this year and that week #1 didn't begin until '3-Jan-2005'. As I said, trial and error seems to show the pattern I described above. I was hoping to get someone to tell me for certain if it is correct or not.

> --
> Daniel A. Morgan
> University of Washington
> damorgan_at_x.washington.edu
> (replace 'x' with 'u' to respond)
Received on Wed Jan 19 2005 - 19:14:29 CST

Original text of this message

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