• david.dartnell (3/16/2014)


    Hi Everyone,

    I would like to 'drop' some trailing zeros from a decimal value, e.g.: 50.000000, and I am wondering how to go about this?

    The value is definitely of decimal type, and in this instance I know that I want to eliminate exactly six (6) zeros.

    Any help here will be greatly appreciated.

    Kind Regards,

    David

    Cast the value to whichever of the integer datatypes is appropriate.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden