Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: field selected depends on value in another field Post Reply Post New Topic
Author Message
00331data
Newbie
Newbie
Avatar

Joined: 09 Mar 2011
Online Status: Offline
Posts: 13
Quote 00331data Replybullet Topic: field selected depends on value in another field
    Posted: 09 Mar 2011 at 1:58pm
How can I create a fomula for the following (which I'm explaining in half formula-speak and half plain English):
 
IF {field.A} = "red" or "blue" 

     then  insert the words "Object Type:   " and concatenate with {field.B}

    

else  (that is to say if {field.A} equals anything else)

   insert the words  "Title:  "  and concatentate with {field.C}

 
I made this formula:

IF

     {field.A} = "red" or "blue"

then 

     "Object Type:  " & {field.B} 

else

     "Title:  " & {field.C}
 
It is incorrect; is this a syntax problem?
 
Thanks...
thanks,
00331data
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 10 Mar 2011 at 2:10am
I believe you have to restate the other side of the equation again after the or. So:
 
If ({field.A}='red'
or {field.A}='blue')
     then 'Object Type: ' & {field.B}
          else 'Title: ' & {field.C}
|< /\ '][' ( )
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 10 Mar 2011 at 2:45am
As FrnhtGLI, you must specify *exactly* what the conditions are.

In english, when I say "is the ball red or blue?" you would probably automatically translate that as "is the ball red or is the ball blue?"

This translation occurs for some reason and in fact the original question could be ambiguous. From my question you could have asked "what's blue?" and I would have to clarify that I am referring to the ball.

Of course, the computer isn't going to ask you what you meant, so it'll just tell you it doesn't know what you're talking about.
IP IP Logged
00331data
Newbie
Newbie
Avatar

Joined: 09 Mar 2011
Online Status: Offline
Posts: 13
Quote 00331data Replybullet Posted: 12 Mar 2011 at 10:20am
Thanks for these great responses--all makes sense & formula, of course, works!
thanks,
00331data
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.047 seconds.