SmokeEater
Technical User
I am using Crystal 9 Advanced and an Oracle 8.1.7.4 database with ODBC connection, CR Oracle ODBC Driver 4.10.
I am trying to get this formula to work
My problem is that occasionaly AVERAGECOST is blank and I then get no result from this code.
I am trying to get this formula to work
Code:
Local NumberVar x; //Declare x to be a Number variable
Local NumberVar y; //Declare y to be a Number variable
x:={ASSETLCF.UNITCOST};
y:={PARTSLCF.AVERAGECOST};
if x <= 0 then x:=0;
if y <= 0 then y:=0;
If IsNull({ASSETLCF.UNITCOST}) then
x:=0
else
x:={ASSETLCF.UNITCOST};
If IsNull({PARTSLCF.AVERAGECOST}) Or Trim(CStr({PARTSLCF.AVERAGECOST})) = " " Then
y:=0
else
y:={PARTSLCF.AVERAGECOST};
if x>y then
x
else
y;
My problem is that occasionaly AVERAGECOST is blank and I then get no result from this code.