Someone could figure it some solution for my issue???
Im still wanting some help
I'm guessing that you have an accumulated overtime amount in a float variable (where 1.0 = 24 hours), and want to display it in an hours-minutes-seconds format? The problem with FormatDateTime is that it's oriented toward displaying a clock time, not to showing durations. Here's an off-the-cuff Fastreport function which might help--it would be placed on the FR "Code" tab:
function formatelapsed(somex: extended): string;
var tt, h1, m1, s1: integer;
ms, ss: string;
begin
ms:='';
ss:='';
// convert datetime elapsed value to integer seconds...is round() better than trunc() for this?
tt := round(somex * 24 * 60 * 60);
// how many hours in tt?
h1 := trunc(tt/3600);
tt := tt - (h1 * 3600);
// how many minutes in remaining part of tt?
m1 := trunc(tt/60);
// remainder should be seconds in tt
s1 := tt - (m1 * 60);
// pad minutes & seconds with leading zero if they're only one digit
if m1<10 then ms:='0';
if s1<10 then ss:='0';
result := inttostr(h1) + ':' + ms + inttostr(m1) + ':' + ss + inttostr(s1);
end;
On the FR "Page", you call this function in a text object: [formatelapsed( YourOvertimeVariable )]. For instance, if your Overtime is 5.15075, the value displayed is 123:37:05.
Please don't assume the conversion function is perfect, I tested it only enough to get it to compile. And if my interpretation of your problem is totally off the mark, just ignore!
Connect with Us