Re: Divide By Zero Error
Posted in 1995
On 10 Aug 1995, Harvey Keown wrote: > Hi All > > Does anyone know how to prevent a 'Divide By Zero Error' when executing a > SELECT. I'm dividing 2 columns in a computed field. There are occasions > when the divisor WILL be zero. When this condition occurs, instead of the > 'Divide By Zero Error' occuring I want the result to be zero. I don't > want to filter the column containing zeros. > > Thxs > Harvey Keown Harvey, Try doing a union and specify where col != 0 in one select, and where col = 0 in the other and write the 0 literal in the correct column (avoiding the col name). Yours, Nick ********************************* Nick Nobbe, Library of Congress NLS/BPH mail: nnob@loc.gov *********************************