Solved

Crystal Reports not filtering on all Parameters

Posted on 2013-05-13
2
231 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal reports - finding a hidden reference 4 74
Use data from .txt file into Crystal reports 9 59
Ignore parameter if no value entered 22 61
Pull date to Group header 6 30
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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