10 Replies Latest reply: Feb 15, 2018 9:57 AM by beck bakytbek RSS

    Differences in Years and in Months

    beck bakytbek

      Hi Folks, i have a question:

       

      my table does look like:

      Project     ReportDate     EndDate      Difference in Months

      A            31.03.2018     30.06.2021          39 Months

       

       

      I am using this function:

       

      step1 : SET MonthDiff = Num(((year($2) * 12) + month($2))-(((year($1) * 12) + month($1))) + 1)

       

      step2: $(MonthDiff(ReportDate, EndDate)) AS MonthsDifference

       

      with this Function i can calculate only differences as interval 40 Months.

       

      My expected Output is

       

      Project  

      A                

      Restmonth this Year   = 9

      Restmonth this Year + 1 Year = 12

      Restmonth this Year + 2 Years = 18

      Sum: 39 Months

       

       

      Does anybody have any idea how to resolve this issue?

       

      Thanks a lot

      Beck