Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am getting "ORA-01722: invalid number" error please advise.

nkandwalSep 2 2015 — edited Sep 3 2015

  date_added is a date column in weather data table. It stores data as 1/30/2002 10:00:00 PM format

  I need to select data from 1/1/2013 00:00:00 AM until 1/1/2013 00:00:00 AM. I am getting "ORA-01722: invalid number" error. Please advise.

here is the table definition

CREATE TABLE MWATCH.WEATHER_DATA_NCIS

(

  WEATHER_SAN       NUMBER(10),

  LOCATION_SAN      NUMBER(10),

  WEATHER_DATETIME  DATE,

  TEMP              NUMBER(3),

  HUMIDITY          NUMBER(3),

  WIND_SPEED        NUMBER(3),

  SKY               VARCHAR2(1 BYTE),

  DATE_ADDED        DATE,

  ADDED_BY          VARCHAR2(15 BYTE)

);

I am getting the error when I do the following select

           select * from weather_data

             WHERE  to_char(date_added,'dd/mm/yyyy hh:mi:ss AM')

           BETWEEN  to_char('1/1/2013 00:00:00 AM','dd/mm/yyyy hh:mi:ss AM')

               AND to_char('1/1/2013 00:00:00 AM'','dd/mm/yyyy hh:mi:ss AM');

*

Error at line 4

ORA-01722: invalid number

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 1 2015
Added on Sep 2 2015
12 comments
1,417 views