Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Next() function in the group Post Reply Post New Topic
Author Message
aleplgr
Newbie
Newbie


Joined: 09 Dec 2006
Online Status: Offline
Posts: 23
Quote aleplgr Replybullet 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?
Thanks in advance
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
IP IP Logged
aleplgr
Newbie
Newbie


Joined: 09 Dec 2006
Online Status: Offline
Posts: 23
Quote aleplgr Replybullet Posted: 20 Mar 2007 at 1:23am

LOL yes, thanks, now I've got a NumberVar IdClient for the actual group and when it changes I know that I'm in the next group

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.