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!

Multiple Parameter Fields 1

Status
Not open for further replies.

gscheepers

IS-IT--Management
Jan 21, 2002
150
US
Hi,

I'm using Crystal 8.5 and was wondering if it's possible to use more than two parameter fields on a report. I'm currently trying to use three parameter fields but it's not liking the formula that I use in Record selection formula:

if {?Extension_Number} = 'All' then
({@CallDate} = {?CallDate})
else
({Extensions.Extn} = {?Extension_Number} and
{@CallDate} = {?CallDate})
else
if {?Dept_Name}='All' then
({Extensions.Extn} = {?Extension_Number} and
{@CallDate} = {?CallDate})
else
({Extensions.Name} = {?Dept_Name} and
{Extensions.Extn} = {?Extension_Number} and
{@CallDate} = {?CallDate})

Any help will be grateful!

Thanks, Gerhard Scheepers
Business Systems Manager - LETEC
 
You can use as many parameters as you like.

Why are you basing the parameters {?Extension_Number} and {?Dept_Name} on exactly the same criteria?
 

*sighs* My bad. I see there is a difference between the two parameter criterias. I'm studying for my Oracle Certification exams today, and so my brain is a bit addled... anyway...

I think your selection formula will return an error because you have too many else concurrent clauses. (1st and 2nd instances of 'else' in the 1st if statement).

What you probably wanted to really do here, is delete the 2nd 'else', and stick a semi colon on the back of the 1st if statement.

Hope this works out for you.

Naith
 
Your second *else* does not have an *if*.

What does *not liking* mean, you get an error, or you don't get the expected result set?

I assume that all of these parameters are single entry values (as opposed to multiple parameter) since you've used an = rather than an in? Since you use "All" as a choice, that

I doubt that it will pass this to the server side, you'll need to change the way it's constructed to do that, but it should still work.

Try this:
// Activates a where clause, or eliminates
// it if the condition is not met
((if {?Extension_Number} = 'All' then
({@CallDate} = {?CallDate})
else
if {?Extension_Number} <> 'All' then
TRUE)

AND

...

This should correct your error, and pass the SQL to the database to improve performance.

You can increase the logic in the IF statements to further qualify each condition, I'd write it up for you but I'm late for the office, if you haven't resolved in a couple of hours, I'll try to make time to write it up.

-k kai@informeddatadecisions.com
 
<grin>

Naith nailed it...

Remember to check for whether it's passing it to the database when you expect it to (providing speed is a concern) by viewing the SQL after entering the parameters

<peddling off to work>

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

Part and Inventory Search

Sponsor

Back
Top