Hi,
First of all there is a typo in the example you give.
if x=111.0 y = 2, round(y/x,2) would not be 55.5.
The solution to your problem is
select ... iif( x > 0, round(y/x,2),0.00) as name ... from ..
Notice the extra zero in decimal part of 'else' of iif()
Bye
Jayesh
>I have a select command like
>
> select ... iif( x > 0, round(y/x,2),0.0) as name ... from ..
> into cursor z
> browse
>
>where x=111.0 y = 2. In the cursor columns name is 56 instead of 55.5. Doing it manually I get the correct result.
>In addition if I use iif(x > 0,round(y/x,2),0) as name I get an single asterisk for name.
>
>What am I missing???
- Jayesh