Board index » delphi » Eliminating NAN Fields in a tables calculated field
Jedi Knight Disco Mike
![]() Delphi Developer |
Sun, 22 May 2005 06:23:44 GMT
Eliminating NAN Fields in a tables calculated fieldHi there !!! I am using calculated fields on a Query Table within Delphi 5 Pro. Within the calculated fields, I get NAN fields when I really want displayed is the number Zero on divisible calculations. I have used a try on EDivByZero and EZeroDivide to try to catch the error. Ideally, when this error happens, I want the field to say Zero, but whichever Exception Error I use, I still see a NAN displayed instead of Zero. The two numbers I am trying to divide (numerator and denominator) are both integer numbers. The resulting variable is of a real type. The resulting variable can be changed to single, double or extended if it would help aleviate this NAN error I keep getting. Because of the NANs that pops up, it messes up any kind of calculations (sumation, average, Min, Max, or Count) I do on that column. Also, when doing calculations in querys, how does Delphi handle calculations when a field is blank ? Is Delphi smart enough to assume that the blank field(s) is zero and still carry out the calculation ? Any thoughts or insights ? Thanks much to anyone that can help !!! |