Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Post Reply Post New Topic
Author Message
cmpm
Newbie
Newbie


Joined: 01 Dec 2008
Location: Portugal
Online Status: Offline
Posts: 5
Quote cmpm Replybullet Topic: Formula
     Posted: 01 Dec 2008 at 3:38am
Good morning...

I need to create 2 formulas based in another one existent.

Formula existent {@Total}

New's formulas to be created
{@Total} - 70%

and

{@Total} - 30%

Crystal give me a message that existe an error: A number or currency value was expeted.

I think that anyone can help me. This important.
Thanks in advance, Carlos
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 01 Dec 2008 at 5:23am
try something like this

evaluateafter({@Total});
{@Total}-({@Total}*0.70)

Sarah
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Dec 2008 at 6:39am

Sarah has the right idea, you could also do this instead of {@Total}-({@Total}*0.70) , just do ({@Total}*0.30) since 100-70% is 30%.

Math is math, why do 2 calculations when 1 is enough. 
 
Just thought that I would throw my 2 cents in.

IP IP Logged
cmpm
Newbie
Newbie


Joined: 01 Dec 2008
Location: Portugal
Online Status: Offline
Posts: 5
Quote cmpm Replybullet Posted: 01 Dec 2008 at 2:26pm
Tanks por reply, but with yours sugestions, Crystal still give me an error. I dont now why!! Its possible sent a rpt file to you, to try to solve this problem?

tanks in advance
Carlos
IP IP Logged
cmpm
Newbie
Newbie


Joined: 01 Dec 2008
Location: Portugal
Online Status: Offline
Posts: 5
Quote cmpm Replybullet Posted: 01 Dec 2008 at 2:58pm
Hy

I have solved this question with this code find in CR foruns:

CDbl({@RF_TotalPagar}) - (CDbl({@RF_TotalPagar}) * 70 / 100)

Tanks for all
CM
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