Link to home
Start Free TrialLog in
Avatar of Michael Katz
Michael KatzFlag for United States of America

asked on

Crystal Reports not filtering on all Parameters

Hello Experts,

I am trying to use the Select Expert for 3 Parameters as follows

if {?Rep} = 'ALL' then {ArTrnDetail.Salesperson} like '*'
else  {?Rep} = {ArTrnDetail.Salesperson}

and

if {?Warehouse} = 'ALL' then {ArTrnDetail.Warehouse} like '*'
else {ArTrnDetail.Warehouse} = {?Warehouse}


and

if {?Customer} = 'ALL' then {ArTrnDetail.Customer} like '*'
else {ArTrnDetail.Customer} = {?Customer}

the problem is that the last parameter is not working.. If i enter 'ALL' or '00001' all records are being returned..I simply want only records that i have entered
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Using parenthesis should help. You can also use this, which is a little more simple and skips the like, which might slow down your query.

(
if {?Rep} = 'ALL' then 1=1
else  {?Rep} = {ArTrnDetail.Salesperson}
)

and

(
if {?Warehouse} = 'ALL' then 1=1
else {ArTrnDetail.Warehouse} = {?Warehouse}
)

and

(
if {?Customer} = 'ALL' then 1=1
else {ArTrnDetail.Customer} = {?Customer}
)