Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select returns integer value instead of a decimal va
Message
 
To
24/02/2000 17:09:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00337156
Message ID:
00337214
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform