I have to date fields and want to find out how many hours it?s between those to date values. And present it with in a textbox. All the fields are in the detail band. Any help is appreciated
I would suggest placing a TppVariable on your report, and in the OnCalc event of the variable, calculate the hours between the two dates using the HoursBetween Delphi method. Something like the following.
uses DateUtils;
procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant); var lStartDate: TDateTime; lEndDate: TDateTime; begin
Comments
I would suggest placing a TppVariable on your report, and in the OnCalc
event of the variable, calculate the hours between the two dates using the
HoursBetween Delphi method. Something like the following.
uses
DateUtils;
procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
var
lStartDate: TDateTime;
lEndDate: TDateTime;
begin
lStartDate := Report.DatePipeline['StartDate'];
lEndDate := Report.DatePipeline['EndDate'];
Value := HoursBetween(lStartDate, lEndDate);
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com