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

Problem with multiple parameter values

Status
Not open for further replies.

mikkom

Technical User
Jul 23, 2010
29
FI
I have a parameter field (static) where are two values: XX and YY and field allows multiple values. And code in selection formula is:

if {?department} = "XX"
then {WORK_ORDER.DEP_CODE_C} in ["AAAA", "BBBB"]
else if {?department} = "YY"
then {WORK_ORDER.DEP_CODE_C} in ["AAAA", "CCCC"]

Problem is that when I choose both values XX and YY in parameter field report shows only values for XX. I think I should change my code in selection formula somehow?
 
Change your parameter to include "All".

Then in select

If {?department} <> "All" then
(if {?department} = "XX"
then {WORK_ORDER.DEP_CODE_C} in ["AAAA", "BBBB"]
else if {?department} = "YY"
then {WORK_ORDER.DEP_CODE_C} in ["AAAA", "CCCC"])
else true

Ian
 
But what if I have 3 values (XX, YY, ZZ) in my parameter and I want to choose two of them?
 
Crystal will execute the first If.. then that is true, that is why you are only getting your XX selection.

Generally you only use a multiple value parameter when that is selecting the data directly

ie {WORK_ORDER.DEP_CODE_C} = {?department}

YOU should make your parameter discreet and then select different lists

eg if {?department} = "ZZ"
then {WORK_ORDER.DEP_CODE_C} in ["AAAA", "BBBB", "CCCC"])

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top