Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Conditional Minimum Post Reply Post New Topic
Author Message
peechy23
Newbie
Newbie


Joined: 17 Jan 2011
Online Status: Offline
Posts: 2
Quote peechy23 Replybullet Topic: Conditional Minimum
    Posted: 15 Feb 2011 at 7:27am
I don't know if this is the right place to post this but I was searching for a problem that I am having with a report.  I currently have a report that is grouped by Property.Id, Building.ID,Leased.ID and I want to pull the minimum newdate by leased.id where field4 equals "Yes"
 
i Tried minimum({Option.newdate},{Leased.ID}) which gives me the correct minimum date for the Leased.ID but I need to take it one step further and have it look for the minimum by where field4 equals "yes"  So the data would be as below
 
Leased.ID   NewDate        Field4
12345        10/01/2011    Yes
12345        09/01/2011    maybe
12345       08/01/2011     no
12345       12/01/2011     yes
 
I would like the data returned to b e 10/01/2011
 
Any suggestions would be greatly appreciated and if this is not the place to post these types of questions please let me know as I am new to this forum.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Mar 2011 at 3:23am
as long as you don't place this in a group header (it won't work there) you could write a formula that would test the value.  Something like:
 
in detailsshared datetimevar amin;
 
if {table.field} < amin then amin := {table.field};
""  //hides the formula
 
in footer
shared datetimevar amin;
 
in group header
shared datetimevar amin := '12/31/2100' //reset to a high value
""//hide the reset
 
realize that you might have already found a solution
 
HTH
 
IP IP Logged
peechy23
Newbie
Newbie


Joined: 17 Jan 2011
Online Status: Offline
Posts: 2
Quote peechy23 Replybullet Posted: 15 Mar 2011 at 3:54am
Thank you for the response.  I was actually able to figure this out.
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.016 seconds.