‎2008 Feb 28 10:55 PM
Hi Gurus
I keep getting a 0 divide error in my query, I think it's because some of the invoices have updated for 0.00 dollars, then we've fixed them and released them to accounting but you know these crap structures, they retain each document history, so have kept the 0.00 values.
THis is my calculation, can you see anything obviously wrong with it puleeeese.
CONT_MARG / (MAT_PRC-FRGT_PROV+ DISC_SURC+FREIGHT ) *100
thank u in advanced
Piroz
‎2008 Feb 28 10:59 PM
if not MAT_PRC-FRGT_PROV < 0 and
not DISC_SURC-FREIGHT < 0.
formula...
endif.
‎2008 Feb 28 10:59 PM
if not MAT_PRC-FRGT_PROV < 0 and
not DISC_SURC-FREIGHT < 0.
formula...
endif.
‎2008 Feb 28 10:59 PM
Hi,
Maybe one of them has value -1 oter 1 and than you get 0. Just debug it. Or log the cases when this expression below is equal to 0.
MAT_PRC-FRGT_PROV+ DISC_SURC+FREIGHT
/wg
‎2008 Feb 29 12:33 AM
Hi,
I would suggest to calculate the denominator first.
A = (MAT_PRC-FRGT_PROV+ DISC_SURC+FREIGHT ) * 100
If A > 0 then perform the other calculation of dividing the value by A.
This should solve problem.
Regards,
Shahu