How to show decimal places only when they exist?

Asked

Viewed 73 times

1

How could I make in my select the numbers appear without decimal place when they are 00 and appear decimal places when they are non-zero.

Example: I have 5 numbers returning like this: 16.00 ; 10.00 ; 3.14 ; 5.00 ; 13.45. How do I get them to return like this: 16 ; 10 ; 3.14; 5 ; 13.45.

  • Can convert to varchar?

  • With what kind of data these numbers are recorded in the bank?

  • The numbers are recorded as decimals.

  • I think it would be okay to convert to varchar, being that the result in the query is what I need.

  • No sql-server-2005 is similar to SELECT Replace(COLUMN, ',00', '') AS P FROM TABLE

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.