2 weeks ago
case when status not in ('Cancelled', 'Closed', 'Filled' ) then sysdate
when date_filled < date_req_approved then date_last_status_change else coalesce(date_filled, date_last_status_change)
end as date_filled
I think the issue is with sysdate.
ERROR: CLI cursor fetch error: [Oracle][ODBC][Ora]ORA-01840: input value not long enough for date format
Any suggestions how to make this work?
2 weeks ago
Are you running pass through. This is more of oracle question but one thing is for sure. columns you are comparing or in coalesce do not have same formats
a week ago - last edited a week ago
Just Googling the error Oracle throws: It could be that the data types of the columns you're using are not all of type DATE and that some implicit conversion is happening. If such implicit conversion is going on then Oracle will use the format as set in NLS_DATE_FORMAT. If this format doesn't match the string it's trying to convert then you could get the Oracle error you observing.
Following this thought: It's possible that NLS_DATE_FORMAT has a different value depending on how you connect to Oracle (via SAS or SQL Developer).
What I would do:
1. Check if all your data types are DATE
2. If not all columns of type DATE: Cast strings to date using an explicit format using the to_date() function. Don't rely on implicit conversions.
2 weeks ago - last edited 2 weeks ago
How is columns sysdate populated? Does it have the same attributes as date_filled, date_req_approved, date_last_status_change?
a week ago
Make sure that all these variable(sysdate, date_last_status_change, date_filled, date_last_status_change) have same date or datetime formats.
If your sysdate is 'DD/MM/YYYY 00:00:00' format and date_last_status_change is 'DD/MM/YYYY' format, then you might get this possible error. Convert them to same format using TO_DATE() in Oracle or convert them all to characters using TO_CHAR.