Joined: 22 Aug 2008
Location: United States
Online Status: Offline
Posts: 2
Topic: Comparing 1st and 2nd dates in a list Posted: 22 Aug 2008 at 8:40am
I have multiple dates in the Details section for each grouped item in my report. How can I do a formula that will give me the difference between the 1st and 2nd dates in the details section?
Example: 1st date - 5/5/08
2nd date - 5/7/08
3rd date - 5/11/08
The difference should be 2 (5/5 to 5/7). Can this be done? Where in the report should I place this info once i have it?
Joined: 22 Aug 2008
Location: United States
Online Status: Offline
Posts: 2
Posted: 26 Aug 2008 at 2:34pm
Cool...now, is there any way I can do this in the group footer section? So it'll just do the difference between the 1st and 2nd dates in the details section?
Joined: 26 Aug 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 26 Aug 2008 at 3:46pm
Create a running total:
RTotal0 - Count the date Evaluate for every record Reset for each group
Create a few formulas:
In Details - RECORD2 - Runs datediff only on the second record. (Can be suppressed)
if {#RTotal0} = 2 then {@DateDiff}
In the group header - VAR_RESET - Resets the Variable to 0 for each group. (Can be Suppressed)
shared numbervar X := 0;
In the Group Footer - VAR_DEC - Declares the Variable and returns the value for the second record shared numbervar X ; if {@RECORD2} > 0 then X := {@RECORD2}; X
If this doesn't work, let me know ( it worked for me)
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