Link to home
Start Free TrialLog in
Avatar of imrancs
imrancsFlag for Pakistan

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
""
Good point.  It won't work on the last record in the report so your mod is needed.

Pete