Skip to main content
November 7, 2011
Answered

round off problem?

  • November 7, 2011
  • 1 reply
  • 873 views

A ColdFusion program is trying to store a value or 0.25 into a column of type decimal(11,6) of SQL Server table but 0.0000000 is getting stored. 0.50 is getting stored at 1.0000000. This started happenning after using cfqueryparam. Maxlength is 17.

What am I doing wrong?

    This topic has been closed for replies.
    Correct answer JMF3

    Without seeing your code, I would guess the CFQUERYPARM is using

    cf_sql_integer instead of cf_sql_float.

    1 reply

    JMF3Correct answer
    Participating Frequently
    November 7, 2011

    Without seeing your code, I would guess the CFQUERYPARM is using

    cf_sql_integer instead of cf_sql_float.

    November 7, 2011

    Was using cf_sql_decimal. Numeric didn't workeither but float did.

    Why is this?

    Thank you very much.

    Owainnorth
    Inspiring
    November 7, 2011

    Because cf_sql_decimal needs the scale="" attribute set in order to use decimal places.