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

Masking a number parameter... 1

Status
Not open for further replies.

jcrawford08

Technical User
Nov 19, 2008
71
US
CR XI R1, SQL environment:

I have a number parameter for values, 1,2,or 3, set to display only the description, allowing no custom values, and allowing multiple selections.

Essentially, I want to display the parameters on the report, however, the end user will not know what 1, 2, and 3 mean, so I need to set up a mask to display based on the parameter(s) selected.

Ideally:
1="Active"
2="Applicant"
3="Inactive"

However, with the potential for multiple selections, it makes generating a cohesive string, at least the way I'm approaching it, a nightmare.... someone PLEASE tell me there's an easier way then a select case statement for each possible outcome???

As always, your input is greatly valued :)


Thanks,

Not in word only, but in deed also... 1Jn3:18
 
Why would that be so hard? Yes, the answer is:

whileprintingrecords;
numbervar i;
numbervar j := ubound({?YourParm});
stringvar x;
for i := 1 to j do(
x := x + (
select {?YourParm}
case 1 : "Active"
case 2 : "Applicant"
case 3 : "Inactive"
) + ", "
);
"Parameter Values Selected: "+ left(x,len(x)-2)

Just substitute in your actual parameter for {?YourParm}.

-LB
 
Thanks LB,

As always - you're a lifesaver :)

Not in word only, but in deed also... 1Jn3:18
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top