Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Datediff question Post Reply Post New Topic
Author Message
the14th
Newbie
Newbie


Joined: 09 Jun 2010
Online Status: Offline
Posts: 1
Quote the14th Replybullet Topic: Datediff question
     Posted: 09 Jun 2010 at 9:30am
Hi,

This seems a fairly easy question but I really can't figure it out.

This is the data that I have in Crystal Report:


296,104 75 75 3  5/27/10  11:31
296,105 75 221 4  5/27/10  11:33
296,155 221 190 4  5/27/10  13:56
296,366 190 190 6  5/28/10  15:05
296,368 190 190 6  5/28/10  15:34
296,374 190 190 14  5/28/10  16:10
296,474 190 190 1  5/31/10  11:17

What I need is to calculate the time difference (elapsed time) for each row by hour. So basically, the "end time" for each calculation will be the bottom  column.

Let's say:
5/27/10  11:33  -  5/27/10  13:56 = 2 hours and 23 minutes.

The output can be any format as long as it indicates the time difference between 2 rows which will be shown in the rightmost side after the date & time

Thanks in advance for any help!

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2010 at 9:39am
You need this per day?
Group on the date field per day.
Use a formula in the group footer as a datediff using minutes between the Minimum date for the group and the maximum date for the group
datediff('n',Minimum(datefield,datefield, "daily"),Maximum(datefield,datefield, "daily")


Edited by DBlank - 09 Jun 2010 at 9:41am
IP IP Logged
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