I'm using Crystal 11 and I’m having trouble with a formula/parameter. I have a parameter called Mkt_Code. The user can choose “LIFECOMP”, “LCOMP-OTHER", “LIFECOMP-ALL”,etc. LIFECOMP-ALL is made up of all the codes LC,LCOT,LCAS,LCCP or they can choose just one to run. The problem I’m having with this is that I can run it and just get LIFECOMP data to return or one of the other single params if I comment out the part of the formula where it checks for the LIFECOMP-ALL. If I want to see records just for the LIFECOMP-ALL then I have to comment out the individual checks for LIFECOMP. It works one way or the other but I can’t get it to work with both codes in there. I've tried adding () but it doesn't seem to make a difference. I hope this makes sense and any help would be appreciated.
Formula:
//{@Mkt_code}
Stringvar mkt;
if {CDE} = "LC" then Mkt := "LIFECOMP"
else
if {CDE} = "LCOT" then Mkt := "LCOMP-OTHER"
else
if {CDE} = "LCAS" then Mkt := "LCOMP-STATE"
else
if {CDE} = "LCCP" then Mkt := "LCOMP-CPA"
else
IF {CDE} in ["LC","LCOT","LCAS",LCCP"] THEN Mkt := "LIFECOMP-ALL";
Mkt
Parameter:
//{?Mkt_Code}
LIFECOMP
LCOMP-OTHER
LCOMPSTATE
LCOMP-CPA
LIFECOMP-ALL
R/S:
{@Mkt_code} = {?Mkt_Code}
Formula:
//{@Mkt_code}
Stringvar mkt;
if {CDE} = "LC" then Mkt := "LIFECOMP"
else
if {CDE} = "LCOT" then Mkt := "LCOMP-OTHER"
else
if {CDE} = "LCAS" then Mkt := "LCOMP-STATE"
else
if {CDE} = "LCCP" then Mkt := "LCOMP-CPA"
else
IF {CDE} in ["LC","LCOT","LCAS",LCCP"] THEN Mkt := "LIFECOMP-ALL";
Mkt
Parameter:
//{?Mkt_Code}
LIFECOMP
LCOMP-OTHER
LCOMPSTATE
LCOMP-CPA
LIFECOMP-ALL
R/S:
{@Mkt_code} = {?Mkt_Code}