Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Minimum excluding zero Post Reply Post New Topic
Author Message
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Topic: Minimum excluding zero
     Posted: 29 May 2009 at 2:28am
Hi - I am trying to put a summary function in a group header which returns the minimum value for an item within that group.  The problem I have, is that in some instances the value of the item is zero or null and I want to exclude these and pick up the lowest value which isn't zero.
 
Any suggestions would be appreciated.
 
Thanks
Evil
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 29 May 2009 at 6:20am
shared numbervar minvalue;
 
if isnull({table.field})=false and {table.field} <> 0 then
  if {table.field} < minvalue then
    minvalue := {table.field};
 
""  //to hide the calculation when formula is on the report.
 
hope this fits the bill.
 
IP IP Logged
Evil McBad
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Evil McBad Replybullet Posted: 29 May 2009 at 7:11am
Thank you so much - this works a treat!
Evil
IP IP Logged
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