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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic help with CR 8.5 if then else statement

Status
Not open for further replies.

ccclsi

MIS
Jan 11, 2002
11
US
Hi, here is what i want to have happen
(If {CUST_ORDER_LINE.UNIT_PRICE} <= {PART.UNIT_PRICE} then [({CUST_ORDER_LINE.UNIT_PRICE}
* {CUST_ORDER_LINE.TRADE_DISC_PERCENT}) when {CUST_ORDER_LINE.TRADE_DISC_PERCENT} <> 0 ]
else {PART.UNIT_PRICE};)
* {RECEIVABLE_LINE.QTY}

i am sure it is a syntax error, but i don't know how to figure it out. Is there software that is intuitive, like would know what i want to do by the above jarbled crap?
TIA, Bill
 
just taking a shot in the dark, i do not have 8.5 nor do i have crystal in front of me, so i apologize in advance for any errors, but perhaps something like this:

If {CUST_ORDER_LINE.UNIT_PRICE} <= {PART.UNIT_PRICE}
and {CUST_ORDER_LINE.TRADE_DISC_PERCENT} <> 0
then (({CUST_ORDER_LINE.UNIT_PRICE}
* {CUST_ORDER_LINE.TRADE_DISC_PERCENT}) * {RECEIVABLE_LINE.QTY})
else {PART.UNIT_PRICE} * {RECEIVABLE_LINE.QTY}
 
I made a mistake. Fisheromacse your formula works but {CUST_ORDER_LINE.TRADE_DISC_PERCENT} is % to subtract from the unit price, so to get the correct total need to take (100 - {CUST_ORDER_LINE.TRADE_DISC_PERCENT} * .01)

eg. a $197 fixture will be discounted 15% so the selling price is $167.45.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top