Aggregate time

edited 10:15PM 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 10:15PM
    dont set displayformat prop of memo to time.
    use plain text and you may have to build your own string from decoded parts.
    ;)
  • edited 10:15PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.