Skip to Content
0

How to display Hour value greater than 24 in report.

Sep 01, 2017 at 05:29 PM

44

avatar image
Former Member

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);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Vitaly Izmaylov
Sep 01, 2017 at 10:13 PM
0

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,"")

Share
10 |10000 characters needed characters left characters exceeded