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!

Dumb Multiple Parameter Question... 2

Status
Not open for further replies.

ChiTownDiva

Technical User
Jan 24, 2001
273
US
Happy Tuesday (I think!)

I don't know why for the life of me I can't ever seem to get this...I think I have a steel plate in my head when it comes to this...

Okay...he goes...

Got a parameter called {?Session Status}. The choices for the session status are:

All
Cancelled
Closed
Full
On Hold
Scheduled

In creating the parameter, I'm allowing multiple parameters and using the "Define Description" button, so the actual values for each are:

All = *
Cancelled = C
Closed = O
Full = F
On Hold = H
Scheduled = S

When I used the parameter in my selection criteria, I did this:

If {?Session Status} <> 'All'
Then {CRSE_SESSION.CRSE_SESSION_STATUS_CD} In {?Session Status}
Else if {?Session Status} = 'All' then {CRSE_SESSION.CRSE_SESSION_STATUS_CD} LIKE '*')


I even tried:

If {?Session Status} <> 'All'
Then {CRSE_SESSION.CRSE_SESSION_STATUS_CD} In {?Session Status}
Else {CRSE_SESSION.CRSE_SESSION_STATUS_CD} LIKE '*')


Neither one works. I know this is something simple that I'm not seeing, but my brain is starting to ooze.

Thanks in advance for any help with this...

ChiTownDiva [ponytails2]
 
you don't state what version you are using ....I'll assume that it is Version 9.0 since I am not familiar with the "Define Description" button.

But it seems straight forward...to me it is for example displaying "All" but passes "*" as the parameter value.

I ALSO ASSUME in your database that the values that you are looking for {CRSE_SESSION.CRSE_SESSION_STATUS_CD} are
"C", "O", "F"...etc

ok so then your selection formula should be something like

(first selection criteria) and
(If {?Session Status} <> "*" Then
{CRSE_SESSION.CRSE_SESSION_STATUS_CD} = {?Session Status}
Else
true;) and
(other selection criteria);

I think you are only sending over 1 criteria...though it isn't exactly clear. If you are sending over more than one...but not "*" ( for All) then your formula would be

(first selection criteria) and
(If not("*" in {?Session Status}) Then
{CRSE_SESSION.CRSE_SESSION_STATUS_CD} in {?Session Status}
Else
true;) and
(other selection criteria);

only use "in" when there is more than one value to compare in an array....the "True" in the else condition selects all records if there is a "*" in the array.


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
If your 'All' parameter is defined as '*' with a description of 'All', then your check for {?Session Status} being = or <> to 'All' will always be false. Try changing your record selection like this:
[tt]
if not ("*" in {?Session Status}) then
{CRSE_SESSION.CRSE_SESSION_STATUS_CD} in {?Session Status}
else if "*" in {?Session Status} then
true
[/tt]
-dave
 
yes...Virdu's formula is better since it will get pushed to the server....my versions should be

(first selection criteria) and
(If {?Session Status} <> "*" Then
{CRSE_SESSION.CRSE_SESSION_STATUS_CD} = {?Session Status}
Else If {?Session Status} = "*" Then
true;) and
(other selection criteria);

or

(first selection criteria) and
(If not("*" in {?Session Status}) Then
{CRSE_SESSION.CRSE_SESSION_STATUS_CD} in {?Session Status}
Else If "*" in {?Session Status} Then
true;) and
(other selection criteria);


depends on how many parameter values sent (one or many)

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top