Subject | Re: [firebird-support] Arithmetics problem (Firebird 1.0.3 WI-V6.2.972) |
---|---|
Author | Markus Ostenried |
Post date | 2004-06-06T19:56:32Z |
At 19:34 Sunday, 06.06.2004 +0000, semprolbat wrote:
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
>Why is it thatHi Magnus,
> select (1 / 100) from rdb$database;
>Returns 0 and not 0,01?
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