Home > database >  ORA - 01843: invalid in which a great god knows how to solve
ORA - 01843: invalid in which a great god knows how to solve

Time:10-05

Select sum (round ((sysdate - to_date (PEND_TIME, 'yyyy - mm - dd HH24: MI: SS')), 0)) from TB_WORKSHEET


An error ORA - 01843: invalid in

How to solve?

CodePudding user response:

PEND_TIME some contents not date format,

CodePudding user response:

Write a cursor, a a check,

CodePudding user response:

PEND_TIME format is wrong, if you value also yyyy - mm - dd HH24: MI: SS this format, if it is 20161115, this format can only use yyyymmdd

CodePudding user response:

The problem of data, suggest you put data specification;

Just posted some sample data;

CodePudding user response:

What is PEND_TIME data type?
If a VARCHAR, that there might be something wrong with your data format, chronological order
If the type of DATE, you can no longer use TO_dATE function

CodePudding user response:

Several comprehensive upstairs said, make sure PEND_TIME inside the data format is correct,
Such as case data


Select substr (TB_WORKSHEET, 6, 2) the from TB_WORKSHEET, which is not 01-12 data are wrong
  • Related