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!

Still need help on "Unique elapsed time" 1

Status
Not open for further replies.

Phillipg

Technical User
May 3, 2002
53
US
This is a tough one for me to figure out.
What I need, is the elapsed time from the end of one job to the start of the next job, grouped by truck ID.
Two tables hold the information that will be needed. One table (Incident) holds all the times for that job and the other (Vehicles) that hold the truck information. The truck information is linked to the Incident table with a “unitID” field. Each record in the incident table has the field “Incident.Timeenroute” and “Incident.Timeinservice”. I have tried everything I could think of to get the results I need without any luck.
I have tried “DateDiff”, “Next”, “Previous”, “if then” and maybe some that I didn’t think would work just to see. I have tried to have two detail sections also.
Any help is appreciated. Thank you.
Phillip
 
If you need the difference between the previous field “Incident.Timeenroute” and “Incident.Timeinservice”, this might get you close:

datediff('n',
maximum({Incident.Timeenroute}, {Incident.Timeinservice},
maximum(previous({Incident.Timeenroute}, previous({Incident.Timeinservice})

This assumes that you want o check for the maximum date of these two fields against the previous maximum date of these two fields, and that you have the records sorted accordingly.

Might get you close...

-k kai@informeddatadecisions.com
 
I think that last post had a logic bomb i that it was expecting SQL control...

But you should be able to do the same thing easily enough within Crystal at the whileprintingrecords level. It seems that you want to do some math based on the current record as compared to the previous or next.

What are the fields that determine: (please be specific)

"What I need, is the elapsed time from the end of one job to the start of the next job, grouped by truck ID."

-k kai@informeddatadecisions.com
 
Thanks, I did have to modify it somewhat to get the results I needed. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top