Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate How long a report took to run

Status
Not open for further replies.

satshergill

Programmer
Jan 25, 2002
34
GB
Any help?

I've looked at craeting formulae for onfirstrecord then currenttime and onlast record then currentime

and subtract one from the other

however I get 0

 
Dear Satshergill,

Try this:

The following will give you the difference between the date time the data was pulled and the date time the data printed! Place in the Report Footer!

(Do not add whileprintingrecords to the formula!)

//begin code
Numbervar Avgsec;
Avgsec := Datediff("s",(DataDate+DataTime),(PrintDate+PrintTime));
NumberVar TotalSec := Avgsec;
NumberVar Days := Truncate (TotalSec / 86400);
NumberVar Hours := Truncate (Remainder ( TotalSec,86400) / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
NumberVar Seconds := Remainder ( TotalSec , 60);

Totext ( Days, '00', 0,'') + ':'+
Totext ( Hours, '00', 0,'') + ':'+
Totext ( Minutes,'00', 0,'') + ':'+
Totext ( Seconds,'00', 0,'')

//end code

Hope this helps,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top