SQL Server Performance

trim zeros

Discussion in 'SQL Server 2008 General Developer Questions' started by Klass49, Aug 4, 2009.

  1. Klass49 New Member

    I am trying to trim zeros from data like the value is 3900.0 and I want it to look like 39.00. What would be a good rtrim use? THanks
  2. MohammedU New Member

    Welcome to the forum...
    do you want to strip only zeros at the end or any zeros?
  3. FrankKalis Moderator

    [quote user="Klass49"]
    I am trying to trim zeros from data like the value is 3900.0 and I want it to look like 39.00. What would be a good rtrim use? THanks
    [/quote]
    The value 3900.0 is certainly different from 39.00 and RTRIM() would not help you in that regard. Looks like a division / 100 could give you the result you want. However, if this is only used for presentation purposes, you should do this in your client.

Share This Page