ORA-01843 not a valid month- Comparing Dates

前端 未结 9 2240
南方客
南方客 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:28

    Just in case this helps, I solved this by checking the server date format:

    SELECT * FROM nls_session_parameters WHERE parameter = 'NLS_DATE_FORMAT';
    

    then by using the following comparison (the left field is a date+time):

    AND EV_DTTM >= ('01-DEC-16')
    

    I was trying this with TO_DATE but kept getting an error. But when I matched my string with the NLS_DATE_FORMAT and removed TO_DATE, it worked...

提交回复
热议问题