Converting mixed negative and positive decimal values all to positive.

  • Hi,

    I’m dealing with a situation where I import data from an excel spreadsheet. One of columns contains decimal amount values, some negative (-256.32) and some not (6586.34). When I initially import the data from the spreadsheet I would like to convert all values to be positive values. Is there some sort of function in MSSQL that can do this, if not what approach can I follow.

    Thank you in advance.

    R

  • SELECT abs(Column_Name)

    FROM Table_Name

    will convert negative to positive and positive stays same

  • The ABS function returns all values as positive. Syntax: [Code]ABS(arg)[/Code]


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • Thanks for all the replies.

    Thats exactly what I was looking for.

    R

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

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