smusba
23rd January 2011, 08:51
Dear Gurus,

I want to write a formula for validation purpose.

The formula is

max1.qty = max1.qty + ((tdsfl101.qana*100)/tdsfl101.qana)-((tdsfl100.wast*0.05)+tdsfl100.wast)
min1.qty = min1.qty + ((tdsfl101.qana*100)/tdsfl101.qana)-((-tdsfl100.wast*0.05)+tdsfl100.wast)

This formula works fine if qana(input Qty) = 100,wast =66 the range will be 30.7 to 37.3
If Qana(input Qty) = 10, wast = 66 it fails.

Bcos Wast percentage is 66 itself

Regards,
MSM

sameer.don
24th January 2011, 07:19
Hi,
First of all, let us know, what results are expected. And what is the logic you want to implement.

Secondly, in this formula, ((tdsfl101.qana*100)/tdsfl101.qana) doesn't make sense, as it evaluates to 100, irrespective of value of tdslf101.qana

I think you need to revisit this part of formula.

And one more suggestion, put a validation on value of tdsfl101.qana. Because, when value of this field equals 0, you program will generate fatal error (devide by zero error).