Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calculate elapsed time in table Post Reply Post New Topic
Author Message
CFStephanie
Newbie
Newbie


Joined: 23 Jun 2011
Location: United States
Online Status: Offline
Posts: 3
Quote CFStephanie Replybullet Topic: Calculate elapsed time in table
     Posted: 23 Jun 2011 at 10:18am
Basically, we have a table of events linked to each client. I've got a report that pulls every change of status in the client's case, but I want to calculate the days elapsed btw Event1 and Event2, down the list. I'm not sure how to do that?

I'm self-taught on CR, so forgive me if I'm missing something ridiculously basic here...

So basically I'd want to return:

ClientName
Date ----Elapsed --Description
6/1/11 ---- 0 ---- EventDescr1
6/3/11 ---- 2 ---- EventDescr2
6/8/11 ---- 5 ---- EventDescr3

Any help appreciated!!

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Jun 2011 at 3:11am
datediff("d",{table.field}, previous({table.field}))
 
I might have the table and the previous reversed (you will get a negative)
 
HTH
IP IP Logged
CFStephanie
Newbie
Newbie


Joined: 23 Jun 2011
Location: United States
Online Status: Offline
Posts: 3
Quote CFStephanie Replybullet Posted: 27 Jun 2011 at 3:35am
Yes, thank you!!  Reversing the order did the trick.
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