Subject | Re: [firebird-support] query Integer overflow |
---|---|
Author | Mr. John |
Post date | 2019-06-23T08:35:54Z |
it is working
thanks
On Sunday, June 23, 2019, 10:00:20 AM GMT+3, Mark Rotteveel mark@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
On 23-6-2019 05:59, 'Mr. John' mr_johnmr@... [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