I have a t-sql I'm using against a table, where I want to count the number of records within a certain category. They are number of accounts, per company. I've been using
SELECT CompanyName, Format(Count(Account), '###,###,###') AS [# Accounts]
GROUP BY CompanyName
My issue is, I copy this out to Excel to use all the time and have to convert it to number once in Excel. The values come out as I want them, using commas to separate to the left of the decimal, but never show the actual decimal values, as it's only ever working with integer values. Is there any way I can have the t-sql format the number the same way, but have it stored as a numeric value, and not as a text value?