2 - Is there any way you can fix the equation in SQL? I don't
know if it's applicable but moving stuff from the left to the
right of a where clause can help performance by using indexes (if
available) but can also avoid errors. For example, a coworker
used to use where NumToDate(numericdate) = current date and
changing that to where numericdate = DateToNum(current date) solved the issue with invalid dates (we also changed NumToDate to
return a null on an invalid date).
3 - Expanding further on functions, could you pass the numeric
field to a function to pass back a number? select ..., MyRpgFunctionToReturnANumberFromDecimalDataErrorField(PotentiallyBadNumber)
From ... ?