Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Time Elapsed Post Reply Post New Topic
Author Message
fuller31
Newbie
Newbie


Joined: 29 May 2017
Location: United States
Online Status: Offline
Posts: 22
Quote fuller31 Replybullet Topic: Time Elapsed
    Posted: 02 Jun 2017 at 6:28am
I am building a report, and part of that report needs to display the time elapsed between a unit going en route and the unit arriving. With the table I am working with, those two times are not in two separate fields. Basically, the table keeps a log - the times display in the same field but there is a new entry for every time the code is changed. The code for en route is ENRT and the code for on scene is ONSC. I cannot figure out how to make a formula that gives me how much time has elapsed between ENRT and ONSC since the field name does not change. I have a formula on another report that gives me time elapsed, but it requires two different fields. I can't figure out how to modify it to work the way I need it to.

numbervar b:= datediff( 's', {table.field1}, {table.field2});
numbervar i;
numbervar n;

i:= truncate( b/3600);
n:=(b mod 3600)/60;
totext(i,0) + 'hrs:' + totext(n,0) + 'min'


If anyone could help with the modification of the above formula, or a new formula, I would really appreciate it. Thank you!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jun 2017 at 7:14am
do you need to do more calculations with this result or just display it in one location for each 'unit'
IP IP Logged
fuller31
Newbie
Newbie


Joined: 29 May 2017
Location: United States
Online Status: Offline
Posts: 22
Quote fuller31 Replybullet Posted: 02 Jun 2017 at 7:42am
Originally posted by DBlank

do you need to do more calculations with this result or just display it in one location for each 'unit'

I have attached a link to an example to clarify.

Basically, I have the report grouped by tow company. There is then a group of call numbers that each of the tow companies responded to. The problem is that the enroute and arrived times are not in two separate fields - it is the same field in the table, it's just that the code is either ENRT or ONSC. So that has been my struggle.

Basically, I want it to calculate the time for each call that each tow truck went on.

https://www.dropbox.com/s/bbl2j6p13ac3e2o/EXAMPLE.PNG?dl=0
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.