precision/scale

  • I have a decimal data type the values in there now look like:

    1233555

    I need i to look like:

    12335.55

    I've tried chaning it from (8,0) to (18,2) but that didn't work..

  • Changing the scale is not going to automatically put two numbers behined the decimal point, it just says that you can now have numbers there.

    You are chaning the value of the number by putting two digits behined the decimal point. One way to easily acheive this is to divide the number by 100

  • As steveb said:

    DECLARE @First DECIMAL(8,0)

    DECLARE @Second DECIMAL(8,2)

    SET @First = 1233555

    SET @Second = @First / 100

    SELECT @Second

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • well this is for an ssis package..and theres no data translation

    so as a sanity check - I'm thinking they are sending us the data incorrectly because with scale I can only change the decimal to the right, correct?

  • Scale will not change the data, I would check the data sources that you are using to see whether or not the values in there have the decimal point.

  • okay...just so im sure about this before I talk to my boss...

    the value from the vendor I'm importing is '584375.00000'

    there's no way for me to change that to '5843.75' using table/schema changes ? (without using code)

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

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