Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date-manupulation
Seems to me you've come up with a pretty exotic date routine there. WW
can only be used as an output format for a date field. I would
recommend writting your own function which multiplies weeks by 7 and
adds the number of days. This would give you days into the year which
you could then use.
EG. Instead of TO_DATE(5351999,'DWWYYYY')
Try TO_DATE((5+35*7)||'1999','DDDYYYY')
Obviously this is not very ledigible so I would create a function to perform the calculation.
Happy Coding,
David Archer
In article <7qe2o7$qa$1_at_news1.skynet.be>,
"Dirk Beelprez" <dbeelpre_at_roularta.be> wrote:
> Hello,
>
> When I run the select-statement
>
> select TO_CHAR( NEXT_DAY(
to_date('30/08/1999','DD/MM/YYYY'),'THURSDAY'))
> from sys.dual
>
> the answers is 02-SEP-99, which is alright.
>
> Now, I only knows the weeknr in the year 1999.
>
> When I use ww in my to_date-format
>
> select TO_CHAR( NEXT_DAY( to_date('5351999','DWWYYYY'),'FRIDAY'))
> from sys.dual
> ( and i 've been trying several ways with WW)
>
> i got the answer
> something like
>
> ERROR:
> ORA-01820: format code cannot appear in date input format.
>
> Is there a smilar way to do this ?
>
> Thanks
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Aug 30 1999 - 13:22:49 CDT