I have a stored procedure that queries some data and emails it, I’d like to change the procedure so that any numbers in the thousands get displayed with commas like 1,000. I guess the best way of doing this in SQL is to convert it to a string and add the comma?
Thanks
Here’s a relatively clean answer. Convert to money (no data type loss). Then convert to varchar with style 1 (it does the commas for you) and then remove the .00 from the end, since it comes with the money data type.
It’s a fine line to figure out how many string manipulations before doing an inline function, but this should be a pretty quick conversion.
Thanks,
Eric