my SP is being passed a column name in the variable named @Report and a name in @Manager, which then I am building this string.
set @SQLString = 'SELECT COUNT(*) FROM LDAPReportTree
Where ' + @Report + ' = ''' + @Manager + ''''
this is what it prints in the reusults window, which is the string itself.
SELECT COUNT(*) FROM LDAPReportTree Where Report1 = 'Flinstone, Fred'
I want it to return a 9
IF I run the string in its own Query window it returns the number 9
so how do I get 9 and not the String itself?
TIA
DougP
set @SQLString = 'SELECT COUNT(*) FROM LDAPReportTree
Where ' + @Report + ' = ''' + @Manager + ''''
this is what it prints in the reusults window, which is the string itself.
SELECT COUNT(*) FROM LDAPReportTree Where Report1 = 'Flinstone, Fred'
I want it to return a 9
IF I run the string in its own Query window it returns the number 9
so how do I get 9 and not the String itself?
TIA
DougP