Hans,
I suspect the confusion is not how Oracle determines the day of the week, but how Oracle determines the week of the year. In MY Oracle database anyway, the days of the week are what you would expect, Sunday=1, Monday=2, etc. (Maybe you have some parameter set in your database to change that…)
However, the beginning of a “week” is determined by THE FIRST DAY OF THE YEAR; it is not “Sunday” by default. This year 1998 started on a Thursday, so “week 43” started on Thursday, Oct. 22nd, not Sunday, Oct. 25th as you assumed.
Look at this query:
select sysdate, to_char(sysdate,‘D’), to_char(sysdate,‘WW’) from dual union all
select sysdate+1, to_char(sysdate+1,‘D’), to_char(sysdate+1,‘WW’) from dual union all
select sysdate+2, to_char(sysdate+2,‘D’), to_char(sysdate+2,‘WW’) from dual union all
select sysdate+3, to_char(sysdate+3,‘D’), to_char(sysdate+3,‘WW’) from dual union all
select sysdate+4, to_char(sysdate+4,‘D’), to_char(sysdate+4,‘WW’) from dual union all
select sysdate+5, to_char(sysdate+5,‘D’), to_char(sysdate+5,‘WW’) from dual union all
select sysdate+6, to_char(sysdate+6,‘D’), to_char(sysdate+6,‘WW’) from dual union all
select sysdate+7, to_char(sysdate+7,‘D’), to_char(sysdate+7,‘WW’) from dual union all
select sysdate+8, to_char(sysdate+8,‘D’), to_char(sysdate+8,‘WW’) from dual
On my database, it returns this:
SYSDATE TO_CHAR(SYSDATE,‘D’) TO_CHAR(SYSDATE,‘WW’)
Listserv Archives (BOB member since 2002-06-25)