Subject Re: [ib-support] Bug in Calculate Fields. Please Help
Author Thomas Miller
Wasn't there some talk about needing to cast integers as floats for
certain math
calculations to work properly? Try casting the QTC to a float/numeric.

news.clix.pt wrote:

>Thanks for the anwser
>i'm using dialect 3
>
>yes this
> select 157809.0000*1.00000000/1077 from rdb$database
>
>works ok but with my table doesn't work
>
>my table is
>CREATE TABLE COMPRAS (
> ID INTEGER NOT NULL,
> REF VARCHAR(15),
> CODEM VARCHAR(5) NOT NULL,
> QTD INTEGER NOT NULL,
> DATA DATE,
> QTDVEN NUMERIC(18,4) NOT NULL,
> CAMBIO NUMERIC(18,8) NOT NULL,
> PRECOTOTAL NUMERIC(18,4),
> INDISPONIVEIS SMALLINT NOT NULL,
> CODMOE VARCHAR(3) NOT NULL,
> PREUNIMOE COMPUTED BY ((PRECOTOTAL/QTD)),
> PREUNIEUR COMPUTED BY ((PRECOTOTAL*CAMBIO/QTD ));
>
>
>PRECOTOTAL=157809.0000
>CAMBIO=1.00000000
>QTD=1077
>
>PREUNIMOE is OK
>PREUNIEUR is not
>
>
>Any comment?
>
>thanks i advance
>
>agostinho.cpis@...
>
>
>""Wilson, Fred"" <fred.wilson@...> escreveu na mensagem
>news:E9E4431A916AD21191FD00104B986AEFC24142@......
>
>
>>Mmmmm, don't know what/how you're doing this, but on FB1.0 the following:
>>
>>select 157809.0000*1.00000000/1077 from rdb$database
>>
>>yields
>>
>>146.526
>>
>>here at work.
>>
>>Best regards,
>>Fred Wilson
>>SE, Bell & Howell
>>fred.wilson@...
>>
>>-----Original Message-----
>>From: news.clix.pt [mailto:agostinho.cpis@...]
>>Sent: Friday, September 20, 2002 9:41 AM
>>To: ib-support@yahoogroups.com
>>Subject: [ib-support] Bug in Calculate Fields. Please Help
>>
>>
>>Hi people
>>
>>I have a big problem.
>>I'm using FB-1.0.0.796-0.64IO.i386.rpm and when I define a calculate field
>>like
>>NUMERIC(18,4)*NUMERIC(18,8)/INTEGER i got wrong values
>>
>>eg. 157809.0000*1.00000000/1077=14652.6462
>>when the correct value is 146.5264
>>
>>Thanks in advance
>>
>>Agostinho Sousa
>>agostinhocpis@...
>>
>>
>>
>>
>>
>>
>>To unsubscribe from this group, send an email to:
>>ib-support-unsubscribe@egroups.com
>>
>>
>>
>>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
>>To unsubscribe from this group, send an email to:
>>ib-support-unsubscribe@egroups.com
>>
>>
>>
>>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
>>
>>
>
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>

--
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork

http://www.bss-software.com



[Non-text portions of this message have been removed]