0 Replies Latest reply: Jul 18, 2012 7:31 AM by 950288 RSS

    CAST function causing error

    950288
      Hi
      I am having difficulty finding a solution to the error i get:
      Error: Syntax Error:Token cast at position 61
      Here is the calculation as I write in the Oracle Bi Discoverer

      MONTHS_BETWEEN("Today's Date",Person Profile.Date Joined)
      cast(cast(floor(months_between(today,d)/12) as int) as varchar(2)) + ‘ ‘ + year(s) + ‘ ‘ +
      cast(cast(mod(months_between(today,d),12) as int) as varchar(2))+ ‘ ‘ + month(s)

      the results i am trying to out out is the amount of time between Todays Date (which is sysdate) and the day the employee joined. I want the output in 1 year and 3 months for example.
      I am using the CAST to change the datatype from int to varchar so that i can get this output.
      I am new to using Oracle BI and PL/SQL.