Skip to Content
avatar image
Former Member

How to display Hour value greater than 24 in report.

Dear Experts,

I am using below formula to display total value in to HH:MM:SS . In below formula when

{@Total_Sec} value is greater than 86400 (86400/3600 = 24 hrs) then i am getting error message "Hours should between 0 to 23", Please suggest how to fix this. Also, i want to display value like 26 Hours 35 Minutes 40 Seconds in this format.

Formula:

local numbervar Hours := 0; local numbervar Minutes := 0; local numbervar Seconds := 0; local numbervar TotalSeconds := {@Total_Sec} ; Hours := Truncate(TotalSeconds / 3600); Minutes := truncate((TotalSeconds - (Hours * 3600))/60); Seconds := Truncate(Totalseconds - (Hours * 3600) - (Minutes * 60)); Time(Hours, Minutes, Seconds);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 01, 2017 at 10:13 PM

    Something like that:

    Numbervar TSec:=100000;
    Numbervar Hrs;
    Numbervar Mns;
    Numbervar Scs;

    Hrs:= Floor (tsec/3600);

    Mns:= Floor (Remainder(tsec, 3600)/60);

    Scs:= Remainder (Remainder(tsec, 3600), 60);

    Totext(Hrs,0,"") + ":" + Totext(Mns,0,"") + ":" + Totext(Scs,0,"")

    Add comment
    10|10000 characters needed characters exceeded