Subject 0 instead a number
Author Arnaldo
Hi List.

I have the following trigger in a table.

CREATE TRIGGER PARCELLE_GARA_BU0 FOR PARCELLE_GARA
BEFORE UPDATE POSITION 0
as
begin
new.PERCENTUALE_MEDIA =
( ( new.PERCENTUALE_UNO - new.PERCENTUALE_DUE ) /
( new.IMPORTO_LAVORI_DUE - new.IMPORTO_LAVORI_UNO )) *
( ( new.IMPORTO_LAVORI_DUE - new.IMPORTO_LAVORI_MEDIO ) +
new.PERCENTUALE_DUE );
end;

the Table Field type is as follow:
PERCENTUALE_MEDIA is declared as numeric( 12,10 );
Value:
PERCENTUALE_UNO is declared as numeric( 12,10 );
Value: 5.4386
PERCENTUALE_DUE is declared as numeric( 12,10 );
Value: 4.9614
IMPORTO_LAVORI_DUE is declared as numeric( 18,2 );
Value: 3.000.000.000
IMPORTO_LAVORI_UNO is declared as numeric( 18,2 );
Value: 2.000.000.000
IMPORTO_LAVORI_MEDIO is declared as numeric( 18,2 );
Value: 2.045.625.000

The above trigger return me -à 0. Instead Excel or a simple hand calculator
give 5.41682775.

Please, Boys and Gals: Any Hints??

Ciao
Arnaldo