Solved

Crystal Reports not filtering on all Parameters

Posted on 2013-05-13
2
230 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
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now