Marco
|
| Posted: 05/02/2002, 8:20 AM |
|
I am using asp + access
In the begore Update / Before Insert event I would like to make a calc based on input fields and saved in a calc field. What is wrong?
fldCALC01 = (fldINPUT1-fldINPUT2)/fldINPUT1
--
(fldINPUT1-fldINPUT2) is working but the /fldINPUT1 is not working????
Any suggestions?
Marco
|
|
|
 |
Ken Hardwick
|
| Posted: 05/02/2002, 9:17 AM |
|
Marco,
Since one can not declare a variable type in ASP..I normally try to
force my variables in a type esp. when doing calculations..
ie...do something like...and I also try to avoid dividing by zero
by adding an if statement checking for when divider = zero....
fldINPUT1 = clng(fldINPUT1)*1
fldINPUT2 = clng(fldINPUT2)*1
if fldINPUT1 <> 0 then
fldCALC01 = (fldINPUT1-fldINPUT2)/fldINPUT1
else
fldCalc01 = 0
end if
|
|
|
 |
|