Subject Re: [firebird-support] Arithmetics problem (Firebird 1.0.3 WI-V6.2.972)
Author Markus Ostenried
At 19:34 Sunday, 06.06.2004 +0000, semprolbat wrote:
>Why is it that
> select (1 / 100) from rdb$database;
>Returns 0 and not 0,01?

Hi Magnus,

have you tried casting it? Something like

select CAST(1 AS DECIMAL(5,2)) / 100 from rdb$database

AFAIR you have to cast one operand so that Firebird will use the correct
type for the result autmatically.
That's because from your statement Firebird cannot extract data types as it
can when you do arithmetics with table columns.

HTH,
Markus