Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: If, then, else formula Post Reply Post New Topic
Author Message
VickiM
Newbie
Newbie
Avatar

Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 28
Quote VickiM Replybullet Topic: If, then, else formula
     Posted: 08 Jul 2011 at 4:21am

Hi!

I'm sure this is a very easy formula, but how do I write an if, then, else formula where the "else" will be a blank if there's no match?  Like, If "x", then "y" else [nothing appears].

Thanks!
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 08 Jul 2011 at 4:28am
if field ='x' then 'y' else ' ' or NULL
sharona
IP IP Logged
VickiM
Newbie
Newbie
Avatar

Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 28
Quote VickiM Replybullet Posted: 08 Jul 2011 at 4:42am
Thanks Sharona!  Here is what I'm trying to do: If {BENEFIT.PLAN_CODE} = ["IUH1"] then "IUH1" else '' and
I get an error that a boolean is required and the '' are highlighted.  What am I doing wrong?
VickiM
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 08 Jul 2011 at 5:02am
 If {BENEFIT.PLAN_CODE} = "IUH1" then "IUH1" else ''
 
REMOVE THE []
sharona
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