I'm new to SQL and stack overflow, I wanted to ask, how to put commas after 3 number?
The result I get is 150444600000.0, what I wanted is 150,444,600,000.0 so I can read the number easier.
Below attached the image syntax for reference
I'm new to SQL and stack overflow, I wanted to ask, how to put commas after 3 number?
The result I get is 150444600000.0, what I wanted is 150,444,600,000.0 so I can read the number easier.
Below attached the image syntax for reference
You can do it with the function printf():
SELECT printf('%,d.%01d', SUM(total_revenue * 30)) AS total_monthly_revenue
There is no need to cast to float.
See the demo.
Please try this syntax
SELECT FORMAT(150444600000.0, 'C4')
Output
$150,444,600,000.0000
For more information check this link: SQL Server Formats