1 Reply Latest reply: May 29, 2009 4:00 PM by Michael Solomovich RSS

    Display a duration in months


      I looked at function "interval" and its formats.

      I'd like to display a duration "in months" between 2 dates ?

      I don't know why but the expression I wrote doesn't give the right answer ...

      Here it is :

      >>>> '&interval((Now() - Min(TKT_CHANGE_DATE)), 'MM hh:mm')


      >>>> '&interval((Now() - Min(TKT_CHANGE_DATE)), 'MM')


      the hours hh:mm are ok, but the values in days are > 30, and values in MM it still 0 ... in both cases !

      What is wrong ?


      Thanks a lot for your help,


        • Display a duration in months
          Michael Solomovich

          MM format doesn't work with interval function. It accepts only days (DD), hours(hh), minutes(mm), and seconds(ss). I assume it is so because month is not a constant time span.
          You can use intrval in days divided by 30, or use a more complex logic if really necessary.