ORA-01821: date format not recognized [TO_DATE]

  • From: Sven Aluoor <aluoor@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 27 Oct 2010 21:02:12 +0200

Hi folks

I wish to have all records where the "time_created" is lesser than
current date minus one hour.

SELECT   *
   FROM trans
  WHERE status = '0'
    AND TO_DATE (time_created, 'YYYY/MM/DD-HH24:MI:SS.FF') < SYSDATE - 1 / 24

time_created is a "VARCHAR2(23 Byte)" with the following contents:

2010/10/27-07:33:04.229
2010/10/27-07:33:03.135
2010/10/21-12:43:18.371

error: ORA-01821: date format not recognized

cheers Sven
--
//www.freelists.org/webpage/oracle-l


Other related posts: