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

Expression error 1

Status
Not open for further replies.

keo216

Technical User
Joined
Nov 26, 2002
Messages
102
Location
US
Can anyone tell me what is wrong with this expression?
I'm using CR 8.5
{mtpm.stockno} is a string
{mtpm.item_cost} is a number
No matter what I do it will give me an error message tellimg me a 'boolean required here'. But it keeps jumping around no matter what I correct.
=========================================================
Expression:

if {mtpm.stockno} in ['10007','10058','10105','10005'] then {mtpm.item_cost} * 1.5 else
if {mtpm.stockno} = '10144' then {mtpm.item_cost} = 40.00
else {mtpm.item_cost} * 1.20

//I'm sure the problem is in the last 'else' but I can't figure it out.



kowen@rrwa.net
 
You can't assign a value to a data field

if {mtpm.stockno} = '10144' then
40.00
else
{mtpm.item_cost} * 1.20

However, if it is a variable, then a colon equal (:=) is required instead of an equal (=)

shared numbervar markup;
if {mtpm.stockno} = '10144' then
markup := 40.00
else
markup := {mtpm.item_cost} * 1.20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top