How to move decimal places :w00t: help me...

  • Hi Frd's,

    I have a table variable column like this

    Sum_percentage

    -------------

    3495.91170000

    514498.97890000

    36325.58660000

    3495.91170000

    514498.97890000

    32416.23920000

    ...nearly 1 million records

    What i need to be is load it like this

    Sum_percentage

    -------------

    3495.91

    5144.98

    3632.58

    3495.91

    5144.98

    3241.62

    ...nearly 1 million records

    _______________________________________________________________

    Need help? Help us help you.

  • This was removed by the editor as SPAM

  • have a look at the round function and divide by a factor of ten to move the decimal.

    though the example you have given show incosistent behaviour where some values are being rounded, some are moving the decimal point One or Two places

    and some are giving completly different numbers;

    eg. 36325.58660000 --> 3632.58

    I am not sure if this is intentional or just a typo?

  • Believe this to be a duplicate post

    http://www.sqlservercentral.com/Forums/Topic1197945-391-1.aspx

  • select CAST(Sum_percentage as money) from tablename

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

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