Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Excluding records meeting 2 conditions Post Reply Post New Topic
Author Message
dlabrec
Newbie
Newbie


Joined: 03 Jun 2008
Location: United States
Online Status: Offline
Posts: 20
Quote dlabrec Replybullet Topic: Excluding records meeting 2 conditions
     Posted: 29 Oct 2009 at 1:52pm
Hi,

I am trying to modify a report for a medical facility. The report currently is pretty simple, it contains patients name, patient ID #, and Potassium (K) and Calcium (Ca) levels.

I am trying to exclude records of patients who have a combination of a Potassium level = 2.00 and Calcium level of 2.50.

I only want to exclude that specific combination. If a patient has potassium = 2.00 and calcium = 2.25 for example, I want that record. The same if potassium = 3.00 and Calcium = 2.50.

I have tried adding a statement to the Selection Expert formula such as:
({DIALYSIS_ORDER_DETAIL.CONC_K} <> 2.00 and
{DIALYSIS_ORDER_DETAIL.CONC_CA} <> 2.50)

but once I save and refresh the report, the statement I added resolves to:
{DIALYSIS_ORDER_DETAIL.CONC_K} <> 2.00 and
{DIALYSIS_ORDER_DETAIL.CONC_CA} <> 2.50

Which is the same, except for leading and trailing parenthesis is missing. This results in the report excluding all records if just the K = 2.00 or just the Ca = 2.50.

How can I write the statement or create a formula that only excludes records if both conditions are met?

Thanks,
Dave

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Oct 2009 at 1:58pm
NOT ({DIALYSIS_ORDER_DETAIL.CONC_K} = 2.00 and
{DIALYSIS_ORDER_DETAIL.CONC_CA} = 2.50)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Oct 2009 at 2:03pm

if you also wanted to exclude the pot=3 and calc=2.5 ...

NOT ({DIALYSIS_ORDER_DETAIL.CONC_K} = 2.00 and
{DIALYSIS_ORDER_DETAIL.CONC_CA} = 2.50)
or
NOT ({DIALYSIS_ORDER_DETAIL.CONC_K} = 3.00 and
{DIALYSIS_ORDER_DETAIL.CONC_CA} = 2.50)
IP IP Logged
dlabrec
Newbie
Newbie


Joined: 03 Jun 2008
Location: United States
Online Status: Offline
Posts: 20
Quote dlabrec Replybullet Posted: 29 Oct 2009 at 2:25pm
Thanks! It works. I didn't think of using "NOT".
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