You must Sign In to post a response.
  • Category: SQL Server

    How to remove the decimal value for the money field

    How to remove the decimal value for the money field in thousand separator

    SELECT CAST(CONVERT(varchar, CAST(123456 AS money), 1) AS varchar)

    o/p
    123,456.00

    i want to remove the last decimal .00 any solution?
  • #664635
    Hi,
    Try this one



    SELECT CAST(CONVERT(bigint, CAST(123456 AS money), 1) AS varchar)

    Thanks in Advance...

  • #664637
    try below code :

    SELECT substring(CAST(CONVERT(varchar, CAST(123456 AS money), 1) AS varchar),1,len(CAST(CONVERT(varchar, CAST(123456 AS money), 1) AS varchar))-3)

    If it helps you then Rate this.

    Best Regards,
    Manoranjan Sahoo
    http://www.dotnetsquare.com
    Blog: http://blog.msahoo.net

  • #664641
    You can type cast it to an Integer for getting rid of decimal.



    select cast(123.456 as int)

    = 123

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.