?
Solved

Crystal Reports not filtering on all Parameters

Posted on 2013-05-13
2
Medium Priority
?
236 Views
Last Modified: 2013-05-13
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
0
Comment
Question by:Mikeyman_01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 39161409
You need to use ( )

(
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}
)

Open in new window


Without the ( ) the AND part is evaluated as part of the else

mlmcc
0
 
LVL 14

Expert Comment

by:LinInDenver
ID: 39161493
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}
)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question