Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing maximum dates 1

Status
Not open for further replies.

tlbeasley

MIS
Feb 13, 2002
3
US
I have created a report that has two dates from separate tables. The first date is a minimum scheduled date, and the second date is a maximum date served. I don't want to print records where the first date is greater than the second. The dates are set up like this:
@sharing=
WhilePrintingRecords;
Minimum({Scheduler.ToDate},{People.Name})
@activity=
WhilePrintingRecords;
Maximum({TrxMaster.TrxDate},{People.Name})

so I set up the formula:
if(@sharing > @actvity) then 0
else 1

I placed this in the detail of the report, and the field comes up blank.

What am I doing wrong?
 
You say that you don't want to "print records", does this mean that you want to display them and only omit when printing, or does this mean that you want to not display nor print them, but those records will be used in the report for aggregates or some such, or that you want to eliminate them from the report completely, or ???

You'll also be better served to post your Crystal and database version too.

You post states that you have a people group, and that you don't want any rows for the people if the minimum of all of the todate field for that person > the maximum of all of the trxdate fields, is that the case?

You might be want to post some example data and expected output rather than using text to describe this.

-k
 
I'm using CR 9.0 and SQL 2000. I want to eliminate all clients from the report where the first date is before the second date.
 
As an aside, you don't need the "Whileprintingrecords" in your formulas. Try placing your formula in the group header--it should provide a value there.

To eliminate people from your report who don't meet your criteria, you can either go to report->edit selection formula->GROUP and enter:

Minimum({Scheduler.ToDate},{People.Name}) <=
Maximum({TrxMaster.TrxDate},{People.Name})

Or you can use section suppression by going to format->section->group header, details, and group footer->suppress->x+2 and entering:

Minimum({Scheduler.ToDate},{People.Name}) >
Maximum({TrxMaster.TrxDate},{People.Name})

-LB
 
Thank you, lbass, for responding. It helped a great deal. The &quot;WhilePrintingRecords;&quot; statement was definitely inappropriate. It all worked just as you said, I can go home finally go home.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top