Many times when doing mass updates or query reports, you run into situations where a "divide by zero" error occurs. Sure, you can put all sorts of error trapping and the like, but there may be conditions where the value you are using to divide is zero. I add a miniscule value to my field that may be zero.
(profit/(prfinv+.0001) ) *100
It doesn't affect the calculation (at least with the decimal precision I'm working with) and protects me from program crashes. The same method can be applied when using a calculated value in SQL.
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Visit the ITKnowledge Exchange and get answers to your developing questions fast.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.