Format a number with commas but without decimals in SQL Server 2008 R2?

后端 未结 5 968
情歌与酒
情歌与酒 2020-12-10 16:06

I am using the following to create a comma formatted number in T-SQL. How can I get rid of the decimal point and the digits after decimal. So if I get 1,112.00 after formatt

5条回答
  •  时光说笑
    2020-12-10 16:26

    https://database.guide/how-to-format-numbers-in-sql-server/

    Starting on SQL 2012 you can write:

    SELECT FORMAT(ColumnName, 'N0');
    

提交回复
热议问题