5 Replies Latest reply on Feb 7, 2016 11:41 PM by Mark Fraser

    Oralce - Date error - Oracle database error 1841: ORA-01841: (full) year must be between -4713 and +9999, and not be 0

    muniyappan.m

      Converting Oracle Char to Date in Tableu

      I have used the below tableau function

       

       

      Dateparse('ddmmyyyy', app_date)

       

       

      throws below error and the query looks like this.

       

       

      Error : Oracle database error 1810: ORA-01810: format code appears twice

       

       

      SELECT TO_NUMBER(TO_CHAR(TRUNC(CAST(TO_TIMESTAMP("Custom SQL Query"."APPROVED_DATE", 'DD/MI/YYYYYYYY') AS DATE)),'YYYY')) AS "yr:Calculation_901282923186704"

      FROM (

       

       

       

       

      as alternate i have tried to convert in the oracle SQL and used the below function

       

       

      TO_CHAR (TO_DATE(a.APP_DATE ,'yyyymmdd'),'ddmmyyyy')as approved_date

      when i tried to load through custom sql, its throwing below error

       

       

       

       

      Oracle database error 1841: ORA-01841: (full) year must be between -4713 and +9999, and not be 0

       

       

      Can someone please advise me if you came across this kind of issuse.Thanks