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!

Fractions of a second 1

Status
Not open for further replies.

JohnWantsToKnow

Programmer
Oct 9, 2002
8
IE
How can I get Crystal to display 10ths of a second? All time formats seem to be just to a whole number of seconds.
I'm trying to get crystal to show the length of time taken to produce a report and display the time taken in the report footer. Suggestions on the best method of doing this also appricated.
Using Ver8.5
 
It is possible. I was a doubter until I tried it.

Here is the formula:

stringvar pt:= totext(printtime,"hh:mm:ss.ss");
stringvar dt:=totext(datatime,"hh:mm:ss.ss");
numbervar pth:=val(left(pt,2));
numbervar ptm:=val(mid(pt,4,2));
numbervar pts:=val(right(pt,5));
numbervar dth:=val(left(dt,2));
numbervar dtm:=val(mid(dt,4,2));
numbervar dts:=val(right(dt,5));
numbervar pttot:=3600*pth+60*ptm+pts;
numbervar dttot:=3600*dth+60*dtm+dts;
numbervar diff:=pttot-dttot;

numbervar hrs:=truncate(diff/3600);
numbervar min:=truncate((diff/3600-hrs)*60);
numbervar sec:=(((diff/3600-hrs)*60)-min)*60;

totext(hrs,"00")+ ":" + totext(min,"00")+ ":" + totext(sec,"00.00")

Mike
 
See Thread149-480703 for timing report processing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top