Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Date Calculation question Post Reply Post New Topic
Author Message
jlaz
Newbie
Newbie


Joined: 19 Jan 2007
Location: United States
Online Status: Offline
Posts: 1
Quote jlaz Replybullet Topic: Date Calculation question
    Posted: 19 Jan 2007 at 11:03am

Hi,

I am in the process of creating a report that will report the number of permits that have met date event milestones. Each permit has a number of milestones to meet (example below) and the dates are calculated using the dates in the EventDesc column. The question I have is this: Using the example table and data below, how can I calculate the date difference (in days) between say EventDateID (7) and EventDateID (3) :

PermitID    PermitNum   EventDate   EventDesc   EventDateID
---------------------------------------------------------------------------------
23               PSD-1206      5/11/06     App Received             1
23               PSD-1206      5/25/06     Determination            2
23               PSD-1206      7/25/06     Complete App Rec      3
23               PSD-1206      8/25/06     Process                      5
23               PSD-1206      9/25/06     Disclosure                  6
23               PSD-1206      11/22/06    Final Decision            7


I tried using the PreviousValue function, but that only allows calculation between the record previous to it like EventDateID (7) and (6) above. I am using Crystal Report version 10, SQL Server 2000 as backend DB and stored procedure.
Thanks

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Jan 2007 at 11:15am
That's quite a trick since the records are spread so far apart and different calculations will use data from different records. I recommend creating global variables (or an array depending how complex this gets) and for every record check to see what the ID is and store it in a particular variable. Then when the report is finished all the variables will have dates and you can do whatever calculations you want to do with them.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.