Joined: 09 Dec 2006
Online Status: Offline
Posts: 23
Topic: Next() function in the group Posted: 19 Mar 2007 at 10:34am
Hi, I have a table with 3 columns: ClientID, Date1 and Date2 grouped by ClientId, and I need to calculate the difference: Date1 - Next(Date2) .
Works fine using the Next() function but the problem is that the Next() function just takes the Next record no matter if it is in the same group or not, so I have problems when the group has just one row and in the last row of all the groups. How could I control that the Next() function selects the next in the SAME group? Is there a way to notice that one record is the last of the group?
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 19 Mar 2007 at 3:38pm
You're going to have to modify the formula to also look at the current group name and compare it to the Next() group field name. Only perform the date calculation when they are different.
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>
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