Subject Re: Arithmetics problem (Firebird 1.0.3 WI-V6.2.972)
Author semprolbat
--- In firebird-support@yahoogroups.com, Milan Babuskov <milanb@k...>
wrote:
> semprolbat wrote:
> > Why is it that
> > select (1 / 100) from rdb$database;
> > Returns 0 and not 0,01?
>
> Because the result of operation on two integers is integer.
>
> You can use:
>
> 1.00/100.00
>
> or
>
> use cast to cast values to appropriate type.

Ok. I tried casting the whole statement as numeric, but of course the
expression within the cast returned integers as well -> status quo. ;-
)

Adding .00's to all the numbers did the trick.
Thanks for the amazingly quick answer!

Magnus