Options

Overflow error converting numeric to data type money

intelcore2quad88intelcore2quad88 Member Posts: 7
Hello everyone,

I have report which get Data by Query SQL using ADO in Navision 2009 R2.
If you want to get decimal value in Query SQL, you need to CAST decimal to Money before passing value to Navision, if you don't cast value to Money, you will get error like that:

This data type is not supported by C/SIDE. You can access data from
any of the following data types:
VT_VOID, VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BSTR and VT_BOOL

But, today I have problem with amount in G/L Entry: 14,138,211,287,616,041, this is overflow datatype Money (Maximum is: +/- 999,999,999,999,999.99)
---------------------------
Microsoft Dynamics NAV Classic
---------------------------
This message is for C/AL programmers:

The call to member Execute failed. Microsoft OLE DB Provider for SQL Server returned the following message:
Arithmetic overflow error converting numeric to data type money.

---------------------------
OK   
---------------------------

I have idea to Cast value to varchar, and in NAV, I will Evaluate it to Decimal variable, but when evaluate value, I still get error with overflow: 999,999,999,999,999.99
---------------------------
Microsoft Dynamics NAV Classic
---------------------------
Decimal must not be 14138211287616041.

Decimal must be in the range of -999,999,999,999,999.99 - 999,999,999,999,999.99.

---------------------------
OK   
---------------------------

I try testing one case: delete amount 14138211287616041 in G/L Entry, and paste 14138211287616041 to table again. When paste value, I will get error:
---------------------------
Microsoft Dynamics NAV Classic
---------------------------
Decimal must not be 14138211287616041.

Decimal must be in the range of -999,999,999,999,999.99 - 999,999,999,999,999.99.

---------------------------
OK   
---------------------------
I don't know how NAV store value to table when it is overflowed.

Can everyone help me to resolve this issues?

Thanks.

Comments

  • Options
    annivasuannivasu Member Posts: 10
    hi intelcore2quad88,

    First of all you have check data type of both fields they should be contain decimal values.
  • Options
    annivasuannivasu Member Posts: 10
    hi intelcore2quad88,

    First of all you have to check data type of both fields they should be contain decimal values.
Sign In or Register to comment.