cancel
Showing results for 
Search instead for 
Did you mean: 

How to display Hour value greater than 24 in report.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

vitaly_izmaylov
Employee
Employee
0 Kudos

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