Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Max function Post Reply Post New Topic
Author Message
Gymnast
Newbie
Newbie
Avatar

Joined: 26 Mar 2012
Location: United States
Online Status: Offline
Posts: 7
Quote Gymnast Replybullet Topic: Max function
     Posted: 26 Mar 2012 at 8:55am
I am trying to display a value only if it meets a certain criteria for which I have a formula - retrieve only the values from the database where the value of a given field > 0:
 
Here is my code:
 
if ({sp_MONTHLY_STATUS_BY_REP1.Status} = "Completed" AND {sp_MONTHLY_STATUS_BY_REP1.CountOfStatus} > 0) then
{sp_MONTHLY_STATUS_BY_REP1.CountOfStatus}
 
Problem is.. I still get records that have a value = 0.  Can someone help, please?
 
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 26 Mar 2012 at 9:17am
I am bit confused.  So are you seeing records where {sp_MONTHLY_STATUS_BY_REP1.CountOfStatus} = 0 (I do not think the formula above would work properly for record selection) or the result of the formula you are seeing 0's?  If you are seeing 0's as the result of your formula, something is seriously amiss.
IP IP Logged
Gymnast
Newbie
Newbie
Avatar

Joined: 26 Mar 2012
Location: United States
Online Status: Offline
Posts: 7
Quote Gymnast Replybullet Posted: 27 Mar 2012 at 6:32am
Thanks.  Solved..
My requirement was to retrieve only the value that was > 0.  And I achieved that by calculating the Running total instead because all the rest in the group were 0 and I needed to capture only the one that was not.
 
But I have a different question though.  Not sure if I can continue to post it here.. maybe I will create a different thread fo r that.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 27 Mar 2012 at 6:57am
You should create a new post.  I will be easier to follow the thread that way.
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