Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Writting correct formula's Post Reply Post New Topic
Author Message
nanowoman2006
Newbie
Newbie
Avatar

Joined: 23 Jun 2011
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote nanowoman2006 Replybullet Topic: Writting correct formula's
     Posted: 23 Jun 2011 at 12:59pm
I have visual studio 2008 and with the version of visual studio that I have, crystal reports is installed on it.  I have a formula that I can't seem to get right.  Every time I run the report it says "a number is required here" and it is completely annoying the crap out of me.  Here is the formula, please tell me what I have to take out or put in for this to work:
 
WhilePrintingRecords;
NumberVar DetAmtClaimed;
DetAmtClaimed:= DetAmtClaimed + {tbPayor.AmtTotal};
Any help is always appreciated.
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 24 Jun 2011 at 2:16am
You must make sure the {tbPayor.AmtTotal} is coming across as a number and not a string. CDBL(), or ToNumber() should fix that for you. It will however give you decimal points, so if that is not desired, just format the field with no decimals.
|< /\ '][' ( )
IP IP Logged
nanowoman2006
Newbie
Newbie
Avatar

Joined: 23 Jun 2011
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote nanowoman2006 Replybullet Posted: 25 Jun 2011 at 7:52am
Wow. thanks for the timely response, it is greatly appreciated. so to i put ToNumber{tbPayor.AmtTotal};
OR
 
tbPayor.AmtTotal.ToNumer?
 
and i thing this is coming across as a string.  I have to check the database table design and make sure.
 
Thanks so much!
IP IP Logged
nanowoman2006
Newbie
Newbie
Avatar

Joined: 23 Jun 2011
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote nanowoman2006 Replybullet Posted: 25 Jun 2011 at 7:55am
FrnhtGLI : I looked it up and got ToNumber({tbPayor.AmtTotal}). I will try this.  Thanks again!
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