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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Average elapsed times 1

Status
Not open for further replies.

susanna123

Technical User
Jan 22, 2010
79
CA
Hi

I was wondering if you can tell me how I can code this:

There are 5 dates/times with start and end in the format below:

Start End
01/05/2010 02:44:47 01/05/2010 03:22:09
01/05/2010 02:37:59 01/05/2010 07:16:27
01/05/2010 02:40:00 01/05/2010 03:23:03
01/05/2010 02:40:00 01/05/2010 03:15:17


For example, if the elapsed time for the first 4 is 20 minutes and a fifth time was 40 min. The average should be 24min, elapse time of 40 min and total time would be 40 min.

How can this be coded using the above example?
Thanks.
 
Hi Kenhamady, may i send you a copy of my report for your review?
 
That level of support is reserved for my customers.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Is there an example that you can provide me with? I can get it so that it displays all records but once parameters are used, it only calculates the average for those set of records based on the parameter values. Displaying all records without parameters would take a long time.
 
I think I have gone about as far as I can go with this. You have to divide the parameters into two groups. Those that affect the filter (which records are included in the average) and those that affect which records are actually seen. Those for the filter go into the selection formula. Those that only affect which ones are seen go into the suppress formula.

Moving selection formula parameters to the suppress formula will mean slowing the report down because you have to read more records to get complete averages.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Hi Kenhamandy,

Does this mean the parameters will not be on the report header. Those fields are currently on the report header. Sorry, I am just starting out with crystal reports and was not able to understand clearly.
 
If you do what I described above, you can also place the parameter fields on the report header (or any other section of the report). Placing a parameter on the report doesn't affect how the report processes in any way.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top