Incorrect conversion from float to decimal.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marina333
    New Member
    • Mar 2010
    • 1

    Incorrect conversion from float to decimal.

    I have two tables in SQL Server with the column name "Quantity".
    Table A data type for Quantity field is float
    Table B data type for Quantity field is decimal (24,11).

    I have an access application that is linked to tables above.
    I enter through the Access form quantity 2594334.38.
    I query table A in SQL query analyzer and it is 2594334.38.
    Then I ran code in access send this number into Stored Procedure in SQL Server which inserts this value into table B.
    When I query table B quantity value is stored as 2594334.3399999 999.

    If I insert directly from Access bypassing the proc then it stores 2594334.38.
    Also if I use a smaller number like 94334.38 then proc inserts the correct number.

    Can I do something in SQL server proc to make this number back into 2594334.38.
    Parameter for this number is declared as float.
    I tried the following things but nothing helps:
    1. Rounded number to 1 or 6
    2. Converted to float.
    3. Converted to decimal.

    1.I use Access 2003 and SQL Server 2005.
    Thank you
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Can't you make the structure the same instead?

    Good luck!!!

    ~~ CK

    Comment

    Working...