I was trying to find the no of days between 2 dates. I tried running the below query and ended up with ORA-30076 error.
Query is,
select extract(day from (sysdate - to_date('2009-10-01', 'yyyy-mm-dd')))
from dual
Error is,
Error at Command Line:1 Column:34
Error report:
SQL Error: ORA-30076: invalid extract field for extract source
30076. 00000 - "invalid extract field for extract source"
*Cause: The extract source does not contain the specified extract field.
But when i try to run
Select extract(day from sysdate) from dual;
i got correct output.
Please help if anyone knows the reason as why i am getting the above error.