Re: DateTime Format Elements

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 3 Jun 2002 08:54:42 -0700
Message-ID: <2687bb95.0206030754.5bd1e59b_at_posting.google.com>


bwall-99_at_alumni.calpoly.edu (Brian D. Wall) wrote in message news:<e4a4deb1.0205311547.265750b_at_posting.google.com>...
> I was looking for a way to find what week of the month a day falls on, but
> found it wasn't working like I expected. Here's an example:
>
> EXPECTED RESULTS:
> May 1, 2002 is a Wednesday, so I would expect the following Results:
> Week #1 = Wed. May 1 - Sat. May 4
> Week #2 = Sun. May 5 - Sat. May 11
> etc...
>
> ACTUAL RESULTS:
> The results I get are as follows:
> Week #1 = Wed. May 1 - Tues. May 7
> Week #2 = Wed. May 8 - Tues. May 14
> etc...
>
> What I find interesting is that the Week of Year function behaves like I
> would expect the Week of Month to behave. The first week of 2002 is Jan 1 -
> 5, not Jan 1 - 7. Why the inconsistency?
>
> Brian

Brian, if would help get a useful response if you posted the SQL you were using to get the Day/Week since Oracle supports more than one week definition. From the SQL manual:

WW Same day of the week as the first day of the year. IW Same day of the week as the first day of the ISO year. W Same day of the week as the first day of the month.

HTH -- Mark D Powell -- Received on Mon Jun 03 2002 - 17:54:42 CEST

Original text of this message