Calc difference between two dates

edited 10:49PM in FastReport 3.0
I am trying to calculate the difference between two dates in my report. Maybe I am just over looking something, but I can't find any functions in FastReports to do that.

Is there any way to get this done?

Comments

  • edited 10:49PM
    What kind of result are you expecting, after all? How many days are between two dates?

    You can just subtract the dates, and you will get it. ;)

    Regards.
  • edited 10:49PM
    ;) Thanks, I don't know why I assumed you had to use a function. Note to self: Next time get some sleep before posting...
  • edited 10:49PM
    Can I transfer the number of days to months
  • gpigpi
    edited 10:49PM
    Yes, you can
    Use NumberOfDays/DaysInMonth
  • edited May 2013
    hello halim,
    I'll give you an example,
    procedure finOnChange(Sender: TfrxComponent);
     var a,m,m1,j:word;
    begin
    DecodeDate(debut.date,a,m,j);
    DecodeDate(fin.date,a,m1,j);
    NB_MOIS.TEXT:=inttostr(int(m1)-int(m)+1);
    end;
    
    where debut and fin are TfrxDateEditControl and Nb_mois is TfrxMaskEditControl
    good luck
    Two will not learn(teach); the shy person and the arrogant person

Leave a Comment