Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Date Diff in Same Column for Each Group Post Reply Post New Topic
Author Message
dirtypotato
Newbie
Newbie
Avatar

Joined: 02 Aug 2012
Location: United States
Online Status: Offline
Posts: 5
Quote dirtypotato Replybullet Topic: Date Diff in Same Column for Each Group
    Posted: 02 Aug 2012 at 12:20pm
Hi,
I am trying to write a formula to calculate the Date Diff between my start dates.  I only want the report to calculate "Days Since Last Shot" for each group(Client).  So i don't want to see the Difference in days between the last record of the previous group.  So in the second group, i dont want to see 169, i want to see 0, but i do want to see the 68 on the next line.   Does this make sense?

Here is what i am using now for my formula:
if not onfirstrecord then
DateDiff ("d",{StartDate},(PREVIOUS({StartDate})))



Nate
IP IP Logged
dirtypotato
Newbie
Newbie
Avatar

Joined: 02 Aug 2012
Location: United States
Online Status: Offline
Posts: 5
Quote dirtypotato Replybullet Posted: 02 Aug 2012 at 12:24pm
Oops there was a screen shot to go with this, guess that doesn't work...

Here is my example:

Group 1

Start Date              Days Since Last Shot
1/20/2011              1
1/20/2011              1

Group 2

Start Date              Days Since Last Shot
8/4/2010                169
5/25/10                  68
5/25/10                  0

Nate
IP IP Logged
dirtypotato
Newbie
Newbie
Avatar

Joined: 02 Aug 2012
Location: United States
Online Status: Offline
Posts: 5
Quote dirtypotato Replybullet Posted: 02 Aug 2012 at 12:37pm
got it....

if (previous ({ID}))={ID} then
DateDiff ("d",{StartDate},(PREVIOUS({StartDate})))
Nate
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.016 seconds.