Solved

Crystal Reports not filtering on all Parameters

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

20 Experts available now in Live!

Get 1:1 Help Now