3
I’m having a problem comparing two dates in the oracle. I’m using the case method to compare the dates and at the end this should return to my table a number, which in the case represents an age, however, I get p error stating:
PL/SQL: ORA-00932: inconsistent data types: expected DATE got NUMBER.
Below is the code snippet that gives the error.
(case when T1.ANO_MODELO = 0 then 0 else (case when ((W_REG.DAT_ENVIO_CALCULO) - T1.ANO_MODELO) < 0 then 0 else ((W_REG.DAT_ENVIO_CALCULO) - T1.ANO_MODELO) End) End)
See the following link in stackoverflow in English. I believe it answers your question. http://stackoverflow.com/questions/11759515/asking-user-to-input-date-in-sql-giving-ora-00932-inconsistent-datatypes-expec
– EduardoFernandes