How to change the scale of decimal calculated columns

  • I have a column with a calculated controls. The column data type is decimal with scale 2, however once I put the calculated formula, the scale field is dimmed and i get a scale of 4.

    The question is how to get the scale to 2 and the other thing is: Is there a technique by which you alter the default scale value for all decimal fields in the database to 2

  • decimal(4, 2) * decimal(4, 2) = decimal(8,4)

    99.99 * 99.99 = 9998.0001

    No you can't set the default scale on the server.

  • So, is there a way to get rid of the right two numbers to get 9998.00 ?

  • It's the application's job.

  • Would this help?

    select 15.25*16.29

    --248.4225

    select cast(15.25*16.29 as decimal(8,2))

    --248.42



    Michelle

  • This worked great, thanks

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply