Sorry to ask such a dumb question, but why can I not convert a varchar to int?
Select [Index Name], count([adj count]) as 'total', cast([adj count] as int) as 'adj count'--, count([adj count]) as 'total' FROM [Test_DB].[dbo].[SPBMI_Count] Where [Index Name] in ('S&P Global Ex-U.S. LargeMidCap (US Dollar)','S&P Emerging SmallCap (US Dollar)', 'S&P Global BMI (US Dollar)', 'S&P Emerging LargeMidCap (US Dollar)', 'S&P Global Ex-U.S. SmallCap (US Dollar)') group by [Index Name],[adj count]
The problem is here.
cast([adj count] as int) as 'adj count'
The datatype is varchar(10)
I tried both cast & Convert; neither works.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.