Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Week numbers and days
Mike Sherrill wrote:
> On Fri, 07 Feb 2003 09:42:42 GMT, "Chris Kruiper"
> <c.a.kruiper_at_home.nl> wrote:
>
> >I want to know the following:
> >
> >I have a week number in a certain year (format YYYYWW) I want to know what
> >date is the wednesday in that week.
>
> Did you consider using a table instead of code?
>
> --
> Mike Sherrill
> Information Management Systems
A table? A bit of a maintenance nightmare. Why not just:
SELECT TO_NUMBER(TO_CHAR(SYSDATE, 'D') FROM dual;
Then use CASE or any other means to determine the following:
If 1 (then Sunday) add 3 If 2 (then Monday) add 2 If 3 (then Tuesday) add 1 If 5 (then Thursday) subtract 1
Daniel Morgan Received on Mon Feb 10 2003 - 11:09:47 CST