Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Text instead of Number Post Reply Post New Topic
Author Message
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Topic: Text instead of Number
    Posted: 14 Dec 2012 at 3:31am
Anyone know how to correct the formula below so I don't get the error "A number is required here"
 
if({@Div Equiv Code})="A" then ({#RTSharesVested}*3.64)

else
if({@Div Equiv Code})="C" then ({#RTSharesVested}*3.64)

else "See chart on next page" <----I Get the error on this text

Thanks,
Steve
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 14 Dec 2012 at 8:18am
You will have to convert your calculations to text.  All results from an if statement have to be the same data type.

if({@Div Equiv Code})="A" then totext({#RTSharesVested}*3.64)

else
if({@Div Equiv Code})="C" then totext({#RTSharesVested}*3.64)

else "See chart on next page"
IP IP Logged
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Posted: 14 Dec 2012 at 9:12am
Thanks - if I convert them to text can I sum the numbers still?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 14 Dec 2012 at 11:37am
Nope.  But with the last else, how would you sum the string?  You may need come up with an alternate way to get the sum (there are several possibilities).
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.