Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: AND operator Post Reply Post New Topic
Author Message
tiffnobody
Newbie
Newbie
Avatar

Joined: 12 Nov 2009
Location: United States
Online Status: Offline
Posts: 2
Quote tiffnobody Replybullet Topic: AND operator
    Posted: 12 Nov 2009 at 8:22am
i'm trying to write a formula using the AND operator but the conditions are based on two separate fields that have nothing to do with each other and one condition is a bit more complicated.  here is what i have:
 
Iif ( ({CnAdrPrf.CnAdrPrf_Type} in ["Good - Busines","Good - Foundation","Good - Home","Good - Seasonal","Home"])
and ( {CnBio.CnBio_Deceased}="No"), 1)
 
what i am trying to do is if both conditions are satisfied, i want a 1 assigned to them, and if both conditions are not satisfied, i want a 0 assigned to them.
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 12 Nov 2009 at 8:54am
What kind of problem are you having ?  You are returning a 1 if the formula is true but you are not returning a zero if it is false.  Don't you need to add the false condition ?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Nov 2009 at 9:30am
Note I have had problesm using IIF instead of If-Then in Crystal. Never figured out why so it may not work even with the below. Adding in John's point of the False 0...
Here is IIF:
Iif ( {CnAdrPrf.CnAdrPrf_Type} in ["Good - Busines","Good - Foundation","Good - Home","Good - Seasonal","Home"]
and {CnBio.CnBio_Deceased}="No",1,0)
 
Here is the If- Then
If {CnAdrPrf.CnAdrPrf_Type} in ["Good - Busines","Good - Foundation","Good - Home","Good - Seasonal","Home"]
and {CnBio.CnBio_Deceased}="No" Then 1 else 0


Edited by DBlank - 12 Nov 2009 at 9:32am
IP IP Logged
tiffnobody
Newbie
Newbie
Avatar

Joined: 12 Nov 2009
Location: United States
Online Status: Offline
Posts: 2
Quote tiffnobody Replybullet Posted: 18 Nov 2009 at 12:27pm
you're right, i forgot to add the false condition!  i realized that after i posted this but thanks so much.  :)
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.