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: Help required with to_date function

Re: Help required with to_date function

From: Ken Denny <ken_at_kendenny.com>
Date: 13 Jan 2004 13:00:24 -0800
Message-ID: <ba944bc3.0401131300.330736cb@posting.google.com>


nageshhatti_at_yahoo.com (Nagesh) wrote in message news:<d6bb3c3d.0401122137.651494ab_at_posting.google.com>...
> I have a column in the database called "DELIVERY_DATE",it is of type
> varchar2. The value of the date(in the string format)is stored as
> "10Jun2002 15:12:30 GMT" (double quotes not included) Now in a query I
> need to use this column in a order by clause.I cannot use the standard
> date patterns in the to_date function.So I decided to truncate the GMT
> part of it. Now it works fine, but what makes this a little more
> complicated is that some vaules will not have this delivery date value
> and hence i get this exception:
> Start server side stack trace:
>
> java.sql.SQLException: ORA-01847: day of month must be between 1 and
> last day of month
>
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
> ..............
>
> How do i solve this.
>
> The DB is oracle 8.1.7
>
> All help is appreciated.
> Thank You
>
> Nagesh

You get this error on rows where this delivery_date column is null, then you should use to_date(nvl(delivery_date,[some default value]),...... Received on Tue Jan 13 2004 - 15:00:24 CST

Original text of this message

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