Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Date-Week conversion

Re: Date-Week conversion

From: Frank <frankbo_at_interaccess.nl>
Date: Mon, 11 Sep 2000 14:27:53 +0200
Message-ID: <8pij4m$cj5$1@porthos.nl.uu.net>

I'm sure he doesn't mind - been working together on this:

create or replace FUNCTION joerg
  (week in IN number
 , year in IN number)
 return date
IS

   jan1st date := to date('01.01.'||year in,'DD.MM.RRRR'); begin

   if to char(jan1st,'IW') <> 1 then

      return(next day(jan1st, 'MONDAY') + (7 * (week in - 1)));    else

      return(next day(jan1st - 7,'MONDAY') + (7 * (week in - 1)));    end if;
end;
/

-- 
Frank
Michel Cadot <micadot_at_netcourrier.com> schreef in berichtnieuws 
8papj1$t40$1_at_s1.read.news.oleane.net...

> It should be fine to give us your solution!
>
> --
> Cheers
> Michel
>
>
> Joerg Sobottka <j.sobottka_at_delta-energy.ch> a crit dans le message
:
> 8pagjs$q1f$1_at_read01.news.ch.uu.net...
> > Hi James,
> >
> > this is not, what I had needed, but I have now a working version.
> > Input: Weekno. and year
> > Output: Monday of this week as date.
> >
> > Regards
> > J rg
> >
> > James Lorenzen <jlorenzen_at_my-deja.com> schrieb in im Newsbeitrag:
> > 8p68dp$bv9$1_at_nnrp1.deja.com...
> > > Joerg; user the ISO year and week date formats. I.E.
> > > "TO CHAR(sysdate,'iyyyy-iw')"
> > > This is the ISO standard for week and year.
> > >
> > > HTH
> > > James
> > >
> >
> >
> >
>
>
--
Received on Mon Sep 11 2000 - 07:27:53 CDT

Original text of this message

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