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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection criteria - change it selectively

Status
Not open for further replies.

revizor

MIS
Joined
Jul 17, 2002
Messages
4
Location
US
I'm modifying CR report. The whole report is based on 50+ data fields that take data within a specified timeframe: x>=DateIn; x<=DateOut

There is, however, one sneaky field that needs to pull out data according to the existing formula, except it does not use the same timeframe - it should go to the database and grab the data up to a certain date (x<DateIn).

When I use Select Expert and change data ranges, it sets the same data range for each and every field. What I need is to &quot;Disregard&quot; the date range for that single field in the report.

Is it making any sense at all?
 
It sounds like you want an OR clause on the date check in the record selection criteria.

Show us the tricky field condition you're using and your current record selection criteria.

-k kai@informeddatadecisions.com
 
Synapsevampire, the select expert condition is not tricky - it's of the following kind:
{payroll.datebilling} < {?dateout} and {payroll.datebilling} > {?datein}

For that one record, it should be:
{payroll.datebilling} < {?dateout}

I think I will end up changing the formulas for the whole bunch of fields to get rid of the select condition.
BTW, can you tell me how?
Say, @SumOfCharges is taking sum of charges in the following form:
Sum({@charges}, {payroll.id})

What do I need to add to this formula to incorporate the condition:
{payroll.datebilling} < {?dateout} and {payroll.datebilling} > {?datein}
 
When you say &quot;What do I need to add to this formula to incorporate the condition: {payroll.datebilling} < {?dateout} and {payroll.datebilling} > {?datein}&quot;

What does that mean? Are you asking how to restrict your report to these values only? If so the answer is a record selection formula.

If this is not what you mean please try to explain it.
Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
The situation can be best shown on the following example:

There is a report on the scores/ performance ratios for a baseball team. The data in this report is covering selected season (select condition: &quot;{payroll.datebilling} < {?dateout} and {payroll.datebilling} > {?datein}&quot;).

How do I insert a field that calculates average_scores_prior_to_that_season into this report? Because as soon as I change the select condition for this single field, all the other fields' conditions are changed too. Do I have to create some sort of subreport to dissociate the initial select condition from the &quot;problem&quot; field?
I'm new to CR, so I'm shooting off the hip here. Please 911
 
revizor: I meant to say *sneaky* not tricky, I was trying to use your terminology.

As for building conditional sums, etc., use Running Totals and place your condition into the evaluate->use a formula.

If you're limiting the number of rows to this season, you obviously won't get last years numbers, so bring in both years data, or as you suggested, you can use a subreport for last years data. I would caution against subreports if you can avoid them, they work fine, but it's more overhead in most respects.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top