Re: return the correct WW value

From: Geoff Muldoon <geoff.muldoon_at_trap.gmail.com>
Date: Wed, 29 Oct 2008 13:01:19 +1100
Message-ID: <MPG.23726efc25dddedd9896a8@news.x-privat.org>


25c23db0006c_at_p39g2000hsb.googlegroups.com>, says...

> I have a problem for retrieving a correct ww. I hit a snag while
> testing the serverPerformanceWeekly script. It seems the
> TO_CHAR(<date>,'WW') function is not returning the correct value. See
> sample below for 26-Oct-2008 (last Sunday), 43 was returned instead of
> 44. How shud i do?
>
> SQL> select to_char(to_date('20081026','YYYYMMDD'),'WW') from
> serverPerformanceWeekly;
>
> TO
> --
> 43
>
> SQL> select to_char(sysdate, 'WW') from dual;
>
> 44

On what "sysdate" did you run the above to get that result? On the Monday after you discovered the "error" or actually on the Sunday? Did you run the above form a client connection? What's your (client and server) NLS_TERRITORY setting? Does that setting default the first day of the week as a Sunday or as a Monday?

Geoff M Received on Tue Oct 28 2008 - 21:01:19 CDT

Original text of this message