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

Add date range parameter to formulas? 1

Status
Not open for further replies.
Feb 17, 2004
52
GB
CR 8.5
SQL2000 db using ODBC link

I'm trying to add a "rule" to my formulas that only bring back results from within my range parameter [date range].

So for example I have the following formula:
(Sum ({@lessthan1day}, {@OperatorName})/DistinctCount ({@IncidentFullID} , {@OperatorName}))*100

This gives me the percentage of incidents resolved within 1 day. However I want to add to this formula and specify only those incidents where the field [arriveDT] is within the boundaries of my parameter [date range].

Any help or pointers would be appreciated. I hope I've explained myself well enough.



Lido
Development & Reporting
UK
 
You didn't share the contents of {@lessthan1day}, but I think you could handle the date range there, as in this madeup formula:

if {table.arriveDT} in {?daterange} and
datediff("d",{table.leaveDT},{table.arriveDT}) < 1 then 1 else 0

Similarly, if you want to limit the denominator to the same date range, you could add the same condition to the formula {@IncidentFullID}.

-LB
 
I apologise

{@IncidentFullID} is...
{IncidentHeader.IncidentGroupUID}&totext({IncidentHeader.IncidentUID},0)

and

{@lessthan1day} is...
if ({IncidentHeader.LastStatusDT}-{IncidentHeader.ArriveDT}) < 1 then 1 else 0



Lido
Development & Reporting
UK
 
Thanks lbass

That is absolutely spot on and worked a treat!



Lido
Development & Reporting
UK
 
Lido,

If I am reading this correctly, you want to suppress anything that is not within your parameters, correct? If so, what I have done in the past is a suppress formula in the section expert.

The formula would be something like:

If {?parameter} = {@formula} then False else True

Let me know if this is not what you are looking to accomplish.

Jeff
 
Conditional suppression is dangerous, because these records will still evaluare and be included in any totalling you are doing.

Consider using the exact same logic in a record selection formula instead.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top