PL/SQL (MOSC)

MOSC Banner

ORA-01841 error

edited Jul 27, 2012 4:16AM in PL/SQL (MOSC) 19 commentsAnswered
Using Oracle DB 9.2.0.5 and Application Server 10.1.2.3

I have a report that is using a query that is returning "ORA-01841: (full) year must be between -4713 and +9999, and not be 0".

the query is:

SELECT COUNT(*) WONOCNT FROM SERVICE_OWNER.SRVC_PROGRAM_VWWHERE PROGRAM = 'MYPROG'AND OFFICE = 901 AND SHPMNT_ID IS NULLAND TO_CHAR(WODATE,'YYYYMM')BETWEEN TO_CHAR(TO_DATE(:FY||'04', 'YYYYMM'), 'YYYYMM') AND

TO_CHAR(ADD_MONTHS(TO_DATE(:FY||'05', 'YYYYMM'),12),'YYYYMM')

SERVICE_OWNER.SRVC_PROGRAM_VW is a view and column PROGRAM is VARCHAR2 and WODATE is DATE.

WODATE column is built from a column named WONO and is a VARCHAR2 column in another table and is converted to a DATE column using

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center