0 Replies Latest reply on Mar 15, 2016 4:23 AM by Dr4ke

    Convert minutes to Hours and Minutes in Crystal Reports

    Apprentice

      Quick tip on how to convert minutes into Hours/Minutes, via the display string formula.

       

      1 // calculate the number of hours by:

      2     // - subtracting the remainder (which returns the remainder after the

      3     // numerator (CurrentFieldValue) has been divided by the denominator (60).

      4     // - dividing the value by 60.

      5 // then convert the result ToText with no (0) decimal places.

      6 ToText((CurrentFieldValue-remainder(CurrentFieldValue,60))/60,0)

      7 + " Hours "

      8 // calculate the number of minutes by:

      9     // - Calculating the remainder after the numerator (CurrentFieldValue)

      10     // has been divded by the denominator (60).

      11 // then convert the result ToText with no (0) decimal places.

      12 + ToText(remainder(CurrentFieldValue,60),0)

      13 + " Minutes"