Re: Comparing Dates

From: Swapan Jha <jhas_at_ix.netcom.com>
Date: 1995/08/09
Message-ID: <40al27$dg8_at_ixnews7.ix.netcom.com>#1/1


In <DD1nJ1.DFB_at_attcetc.cetc.att.com>
Brit.Willoughby_at_WichitaKS.ATTGIS.Com (Brit Willoughby) writes:
>
>
>Why does the following occur?
>
>SQL> r
> 1 select * from brit_attr_value where TO_DATE(attr_value) between
> 2* sysdate and sysdate+7;
>ERROR:
>ORA-01858: a non-numeric character was found where a numeric was
 expected
>
> attr_value is a non-null varchar2(25) in the form DD-MON-YY, so
 it
>should be easily converted by the TO_DATE function. This works fine in
 ProC,
>but fails when run directly from SQL.
>
> Any ideas?
>
> Brit Willoughby
> Brit.Willoughby_at_WichitaKS.ATTGIS.Com
Hi,

    I tried
SQL> DESC X

 Name                            Null?    Type
 ------------------------------- -------- ----
 Y                                        VARCHAR2(25)

SQL> SELECT * FROM X
  2 /

Y



10-AUG-95 SQL> SELECT * FROM X
  2 WHERE Y BETWEEN SYSDATE AND SYSDATE+7; Y

10-AUG-95 it works without to_date also.
Swapan Received on Wed Aug 09 1995 - 00:00:00 CEST

Original text of this message