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!

Using variable name in parameter 1

Status
Not open for further replies.

dacards

Technical User
Apr 11, 2006
26
US
Using Crystal 10. I've searched but couldn't find an answer to this one.

I have a report where users will search based on one or more colors. In my table there is no field that shows actual colors - just a numeric value that equals a particular color:

1=Red
2=Blue
3=White
4=Black

I've got the below parameter set up where users will see the entire list of colors, since they do not all know the numeric equivalent. They are allowed to pick multiple values.
{?Color}
Red
Blue
White
Black

I then set up a formula {@color conversion} that goes as follows:

If {?Color}=Red" then 1
else
if {?Color}="Blue" then 2
else
if {?Color}="White" then 3
else
if {?Color}="Black" then 4

I'm then putting this formula in my record selection where is says:

{CIT_Color_ID}={@color conversion}

I don't get any errors, but using a formula here I'm only bringing back one choise. I know there is data for all four choices. But if someoen picked Blue and White, you'd only get data for Blue.

Any help is appreciated and let me know if I can explain this better.
 
You should set up {?Color} as a number parameter, and use the number as your value field, and then add the color description as the description field. Set "allow multiple values" to true. You can also choose to display only the description on the prompt screen. Then your record selection formula would simply be:

{CIT_Color_ID} = {?Color}

-LB
 
That was too easy - thanks for opening my eyes !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top