ORA-01843 not a valid month- Comparing Dates

前端 未结 9 2234
南方客
南方客 2020-12-15 03:49

I have a problem when try to select data from a table filtering by date.

For example:

SELECT * FROM MYTABLE WHERE MYTABLE.DATEIN = \'23         


        
9条回答
  •  遥遥无期
    2020-12-15 04:36

    I know this is a bit late, but I'm having a similar issue. SQL*Plus executes the query successfully, but Oracle SQL Developer shows the ORA-01843: not a valid month error.

    SQL*Plus seems to know that the date I'm using is in the valid format, whereas Oracle SQL Developer needs to be told explicitly what format my date is in.

    • SQL*Plus statement:

      select count(*) from some_table where DATE_TIME_CREATED < '09-12-23';
      

    VS

    • Oracle SQL Developer statement:

       select count(*) from some_table where DATE_TIME_CREATED < TO_DATE('09-12-23','RR-MM-DD');
      

提交回复
热议问题