Skip to content

A Quick Report that works fine viewed directly in IFS throws 'Excel Plugin Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0' when exported to Excel, even though the SQL runs correctly for normal viewing. What's causing this specifically for the Excel export path?

Answer

This typically happens when a WHERE clause wraps a context-substitution variable (like a date-token placeholder, or the equivalent Context_Substitution_Var_API.Get_Client_Value__ function call) inside an additional TO_DATE(...) conversion — since that function already returns a genuine DATE value, wrapping it in another TO_DATE() call is redundant and can produce this exact invalid-year error specifically under the Excel export/plugin execution path, even though the same redundant conversion happens to be tolerated when the report is just viewed directly in IFS. Remove the extra TO_DATE() wrapper so the already-DATE-typed context-substitution value is used directly in the comparison, rather than converting it a second time.

← Browse Reporting and analytics questions