Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Formula Fix 1

Status
Not open for further replies.

Crystalfire

Programmer
Jan 29, 2002
315
0
0
US

I have this formula which works fine until the
{QUOTE_PRICE.TRADE_DISC_PERCENT} is null or 0. Then I don't get a value.

{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}*({QUOTE_PRICE.TRADE_DISC_PERCENT}/100) )

Using Crystal 8.5
 
Try:

if isnull({QUOTE_PRICE.TRADE_DISC_PERCENT})
or
{QUOTE_PRICE.TRADE_DISC_PERCENT} = 0 then
0
else
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}*({QUOTE_PRICE.TRADE_DISC_PERCENT}/100) )

-k
 
I still need the first part of the formula to work
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}

Using your formula just gives me 0.
 
Code:
if isnull({QUOTE_PRICE.TRADE_DISC_PERCENT})
or
{QUOTE_PRICE.TRADE_DISC_PERCENT} = 0 then
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}
else
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}*({QUOTE_PRICE.TRADE_DISC_PERCENT}/100) )

If this isn't what your after then please explain what result you wouldexpect if the {QUOTE_PRICE.TRADE_DISC_PERCENT} is null or zero.

try giving examples.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}*({QUOTE_PRICE.TRADE_DISC_PERCENT}/100) )

{QUOTE_PRICE.UNIT_PRICE}=$1,260.00
{QUOTE_PRICE.QTY} = 2


{@UNIT*QTY}={QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}

{QUOTE_PRICE.TRADE_DISC_PERCENT}/100)= 15%

If the {QUOTE_PRICE.TRADE_DISC_PERCENT}/100}has a value,like 15% then the result is $2142.00 but if the
{QUOTE_PRICE.TRADE_DISC_PERCENT}/100} is null or 0 then the end result is 0 instead of $2520.00

 
Code:
if isnull({QUOTE_PRICE.TRADE_DISC_PERCENT})
or
{QUOTE_PRICE.TRADE_DISC_PERCENT} = 0 then
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}
else
{QUOTE_PRICE.UNIT_PRICE}*{QUOTE_PRICE.QTY}-({@UNIT * QTY}*({QUOTE_PRICE.TRADE_DISC_PERCENT}/100) )



Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top