Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Filtering Multiple Criteria Post Reply Post New Topic
Author Message
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Topic: Filtering Multiple Criteria
     Posted: 10 Jan 2011 at 6:23am
I would like to pull records that meet multiple criterion. For example, I would like records to be called when a specific field associated with the record is not equal to "NEW" "ABDN" or "DISC"

My record filter looks like this after:

Date filter AND
{mfp_list.last_result_code}<>"NEW" OR
{mfp_list.last_result_code}<>"ABDN" OR
{mfp_list.last_result_code}<>"DISC

Am I doing something wrong or did I omit something vital. Thanks in advance.

-Neal

Edited by npatel - 10 Jan 2011 at 6:24am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 10 Jan 2011 at 6:37am
Maybe you can add some brackets to your statement?


Date filter AND ({mfp_list.last_result_code}<>"NEW" OR
{mfp_list.last_result_code}<>"ABDN" OR {mfp_list.last_result_code}<>"DISC")


My understanding of boolean logic is it would be grouped like this if you don't specify it explicitly


(Date filter AND {mfp_list.last_result_code}<>"NEW") OR {mfp_list.last_result_code}<>"ABDN" OR {mfp_list.last_result_code}<>"DISC"


Otherwise, is there something wrong with the output?

Edited by Keikoku - 10 Jan 2011 at 6:48am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2011 at 6:45am
I would alter it a bit differently as you want all of your ORs parenthed to act as one part of the statment
Date filter AND ({mfp_list.last_result_code}<>"NEW" OR {mfp_list.last_result_code}<>"ABDN" OR {mfp_list.last_result_code}<>"DISC )
 
 
Or you can rework it as:
Date filter AND
NOT({mfp_list.last_result_code} in ["NEW","ABDN","DISC"])
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 10 Jan 2011 at 8:01am
Thank You DBlank. That worked perfectly.

-Neal
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum