Aggregate time

edited 8:06PM in FastReport 3.0
How I can aggregate TIME?

This is working:
[SUM(StrToTime(<frxMny."idotartam">),MasterData1)]

but the problem is that by this way I'm not able to display more than 24 hours in hh:mm format

for instance: 34:12 -> 34 hours and 12 minutes

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:06PM
    dont set displayformat prop of memo to time.
    use plain text and you may have to build your own string from decoded parts.
    ;)
  • edited 8:06PM
    Thank's, it's almost works.

    The problem is that in the case when the time is longer as 48hours it's working false.

    Because the starting date is 1899.12.30
    +48 hours is 1900.01.01
    then my procedure dosn't work.. ;)

    procedure GroupFooter2OnBeforePrint(Sender: TfrxComponent);
    var
    aDate: TDateTime;
    Year, Month, Day, Hour, Min, Sec, MSec: Word;
    begin
    aDate:=SUM(StrToTime(<frxMny."idotartam">),MasterData1);
    decodedate(aDate, Year, Month, Day);
    decodetime(aDate, Hour, Min, Sec, MSec);
    hour:=hour+((month-12)*((day-30)*24))+((day-30)*24);
    memo25.text:=inttostr(Hour)+':'+inttostr(Min);
    end;

    Can You help me with a detailed sample?

Leave a Comment