9 Replies Latest reply on Sep 20, 2016 5:52 PM by Alok Surana

    Difference between dates



      I need to calculate difference between colum BIRTH_DATE (type is datetime) and parameter @{p_date_till}.

      This is what I've tried:


      1. TIMESTAMPDIFF(SQL_TSI_YEAR ,  BIRTH_DATE, Cast(Cast(@{p_data_iki} as Char) as Timestamp))


      --It gives correct formula, but in results tab gives error:

      ORA-01847: day of month must be between 1 and last day of month at OCI call OCIStmtFetch.


      2. TIMESTAMPDIFF(SQL_TSI_YEAR ,  BIRTH_DATE, @{p_data_iki} )


      --It gives incorrent formula:

      Function TimestampDiff is called with an incompatible type.

      --Also when I ignore formula error and press results tab I get the same error.

      --But when I open analysis in view mode (open from catalog) and type value 2016-01-01 in parameter @{p_data_iki} then I get results which I needed.


      The problem is that i can get results, but I cannot edit table, because of error in results tab.



      --obiee 12c