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: Week numbers and days

Re: Week numbers and days

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Mon, 10 Feb 2003 09:09:47 -0800
Message-ID: <3E47DCDB.3DBD41F8@exesolutions.com>


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

etc.

Daniel Morgan Received on Mon Feb 10 2003 - 11:09:47 CST

Original text of this message

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