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

Selecting Records that are Unavailable 1

Status
Not open for further replies.

KalebsDad78

Technical User
May 6, 2006
57
US
Hello all...

I have a report I created and I'm having a problem with being able to select a formula to drill down the report into the data I want to see.

I have a formula "LateFlags" that is a number and "LateFlags_True" that is a string. Neither of these show up in the "Select Expert - Record" so I can get what I need in this report.

The "LateFlags" formula is:

if {Call_Types.descr}="*Life Emergency" and {@Response Time}>"00:08:59" and {Zones.descr} like "*(City of)" then 1 else
if {Call_Types.descr}="*Non Life Emergency P/1" and {@Response Time}>"00:10:59" and {Zones.descr} like "*(City of)"then 1 else
if {Call_Types.descr}="*Non Life Emergency P/2" and {@Response Time}>"00:15:59" and {Zones.descr} like "*(City of)"then 1 else
if {Call_Types.descr}="*Life Emergency" and {@Response Time}>"00:12:59" and {Zones.descr} like "*County" then 1 else
if {Call_Types.descr}="*Non Life Emergency P/1" and {@Response Time}>"00:15:59" and {Zones.descr} like "*County"then 1 else
if {Call_Types.descr}="*Non Life Emergency P/2" and {@Response Time}>"00:20:59" and {Zones.descr} like "*County"then 1 else 0

and the "LateFlags_True" formula is:

if {@LateFlags}=1 then "True"


I am wanting to basically be able to show records that have a "1" to show up in the report and those with a "0" to be filtered out.

I have tried multiple different formulas and ways to get this to show up in the selector.

I need someones expertise here.

Thanks
 
I've tried that and I get the statement, "This formula cannot be used because it must be evaluated later."

Also, just FYI - I'm using Crystal 2008.
 
You need to show the content of all nested formulas.

-LB
 
Sorry, I forgot about the "Response Time" formula.

Here it is:

//This is the display of the response time in the (Day,hr,min,sec) dd-hh:mm:ss format

whileprintingrecords;
NumberVar totalsecs :=(((({@Date Time At Scene} - {@Date Time Received})*24)*60)*60);
Numbervar dd := 0;
Numbervar hh := 0;
Numbervar mm := 0;
Numbervar ss := 0;

// for trips that never got on scene
If {Trips.atsdate} = "1900-01-01" then totalsecs := 0 else totalsecs := totalsecs;

If totalsecs < 0 then
(
// for trips that had a negative response time
// Days
If totalsecs <= -86400 then
(dd :=Truncate (totalsecs / 86400,0 );
totalsecs := totalsecs - (dd * 86400 ) );

// Hours
If totalsecs <= -3600 then
(hh :=Truncate (totalsecs / 3600,0 );
totalsecs := totalsecs - (hh * 3600 ) );

// Minutes
If totalsecs <= 60 then
(mm := Truncate (totalsecs / 60,0 );
totalsecs := totalsecs - (mm * 60 ) );

// Seconds
ss := totalsecs;

If dd=0 then
// display hh:mm:ss
ToText(hh,"00",0 ) + ":" + ToText(mm,"00",0 ) + ":" + ToText(ss,"00",0 )

else

// display dd-hh:mm:ss
ToText(dd,"00",0 ) + "-" + ToText(hh,"00",0 ) + ":" + ToText(mm,"00",0 ) + ":" + ToText(ss,"00",0 )

)

else

(
//for trips with a normal response time
// Days
If totalsecs >= 86400 then
(dd :=Truncate (totalsecs / 86400,0 );
totalsecs := totalsecs - (dd * 86400 ) );

// Hours
If totalsecs >= 3600 then
(hh :=Truncate (totalsecs / 3600,0 );
totalsecs := totalsecs - (hh * 3600 ) );

// Minutes
If totalsecs >= 60 then
(mm := Truncate (totalsecs / 60,0 );
totalsecs := totalsecs - (mm * 60 ) );

// Seconds
ss := totalsecs;

If dd=0 then
// display hh:mm:ss
ToText(hh,"00",0 ) + ":" + ToText(mm,"00",0 ) + ":" + ToText(ss,"00",0 )

else

// display dd-hh:mm:ss
ToText(dd,"00",0 ) + "-" + ToText(hh,"00",0 ) + ":" + ToText(mm,"00",0 ) + ":" + ToText(ss,"00",0 )
)

 
Yup, that was it. Man, those little things like that just kill me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top