I am trying to return the minimum of a date in crystal reports XI and I get blank values returned. I have done some investigation and it appears that crystal reports struggles to return the minimum of date fields. From reading up it appears that a variable is the best way to achieve this. I have no experiences of working with variables in crystal reports - so I badly need some help!
Now for the detail!
Originally I had a field called "Rate Set Date". this has the following formula:
if {EVENTS.COMMENTS}<>"RATE SET" then Date(1900,01,01) else if
{EVENTS.STATUS}="A" then Date(1900,01,01) else if {EVENTS.CCY}={transrpt.CCY} then if
{EVENTS.COMMENTS}="RATE SET"and {EVENTS.STATUS}="U" then {EVENTS.ACTION_DT}
So basically the EVENTS table has multiple records and I am only interested in those that have the COMMENTS "RATE SET" and the EVENTS.STATUS set to "U"
This was put in the details section of the report.
I have one group in the report grouped on transrpt.DEAL_NO. I then wanted to return the minimum of the "Rate Set Date" field in the group footer for transrpt.DEAL_NO. When the report failed to return the minimum I attempted to create a variable called "Global Variable" in the formula fields section. This has the following formula:
Global DateVar ratesetdate;
if {EVENTS.STATUS}="U" and {EVENTS.COMMENTS}="RATE SET" and ratesetdate =minimum({EVENTS.ACTION_DT},{transrpt.DEAL_NO}) then ratesetdate={EVENTS.ACTION_DT}
I put this in the details section of the report.
I have a variable reset field called "Variabe Reset" that I have added to the Group header that has the following formula:
WhilePrintingRecords;
Shared DateTimeVar ratesetdate=Date(1900,01,01);
I have then got a bit stuck - I am sure I need something in the group footer but I am not sure what to put!
Any advice gratefully received!