Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to convert a year+week to a date ?
I found this while looking for another piece of code. This adjusts the week to being the IW for this code.
SELECT TO_DATE(:b || (:a)*7,'yyrrddd')
James
In article <95mflv$rsu$1_at_nnrp1.deja.com>,
James Lorenzen -XIOtech Corporation <jlorenzen_at_my-deja.com> wrote:
> Deepest:
> You might try this:
> select to_date(substr(my_string_field,1,4) ||
> (substr(my_string_field,5,2)-1)*7,'YYYYDDD') from dual ;
>
> This will take some adjusting to handle the beginning of the week for
> WW and IW formats, but it should get you started.
>
> James
>
> In article <981380148.833458_at_dedale.pandemonium.fr>,
> "Deepest Blue" <no_at_where.com> wrote:
> > I can't find the way to translate a year and week field to a date
> > datatype with the WW or IW format.
> > In my string field I have 6 characters like 200108 for week 8 of
> > year 2001, how can I have the starting date for this week ?
> > I tried to_date(my_string_field,'YYYYWW') with no success...
> > I have Oracle 7.3.2.3.0.
> >
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
Received on Mon Feb 05 2001 - 15:39:24 CST