On 23-6-2019 05:59, 'Mr. John' mr_joh...@yahoo.com [firebird-support] wrote:
> 
> 
> the error is gone if I cast one of the values as integer (at this moment 
> there is no decimal needed for that field):
> 
> 
>    CAST (b.P_TV_E AS INTEGER)
> instead of
>   b.P_TV_E
> 
> 
>   SELECT   b.cant*  IIF(b.PR_EAT_T<>0, b.PR_EAT_T-b.PR_EAT_T *  CAST 
> (b.P_TV_E AS IN TEGER)   /(100+ CAST (b.P_TV_E AS INTEGER) ), b.PR_I)
>                   FROM GS_FIED a INNER JOIN GS_FIEP b on a.id=b.id_doc

You can also cast intermediate results to the desired (or sufficient) scale

b.PR_EAT_T-b.PR_EAT_T* cast(b.P_TV_E /(100+b.P_TV_E) as numeric(18,2))

etc...

-- 
Mark Rotteveel
  • [firebird-support... 'Mr. John' mr_joh...@yahoo.com [firebird-support]
    • Re: [firebir... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
      • Re: [fir... 'Mr. John' mr_joh...@yahoo.com [firebird-support]
        • Re: ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
          • ... 'Mr. John' mr_joh...@yahoo.com [firebird-support]
      • Re: [fir... 'Mr. John' mr_joh...@yahoo.com [firebird-support]
        • Re: ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
          • ... 'Mr. John' mr_joh...@yahoo.com [firebird-support]

Reply via email to