• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4546
  • Last Modified:

How to get last record of group

Hi Experts

i need a function in crystal report 11 that return true if group has last record and return false if not a last record of group just like onlastrecord function. tell me how can i do this?

Thanks,
Ahmad
0
imrancs
Asked:
imrancs
  • 2
1 Solution
 
peter57rCommented:
Hi imrancs,
Assuming you group on a field called mygroupfield then you have a formula like:

If {Mytable.mygroupfield} <> Next({Mytable.mygroupfield}) then
"different"
//do something if different
else
// the same ; do nothing
""

Pete
0
 
frodomanCommented:
I'm not sure how that formula will act on the last record of the report.  If it doesn't behave correctly for the last record you can add a check for that to Pete's formula:

If OnLastRecord or ({Mytable.mygroupfield} <> Next({Mytable.mygroupfield})) then
"different"
//do something if different
else
// the same ; do nothing
""
0
 
peter57rCommented:
Good point.  It won't work on the last record in the report so your mod is needed.

Pete
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now