Issue adding a variable with list of values into SQL
Does anybody have any idea why this works -->
| SELECT DISTINCT(countryLong) AS CountryLong | |
| FROM ipcountry | |
| WHERE countryShort IN ('US','UK') | |
| ORDER BY countryLong |
But this does not work -->
<CFSET target_country = "'US','UK'">
| SELECT DISTINCT(countryLong) AS CountryLong | |
| FROM ipcountry | |
| WHERE countryShort IN (#target_country#) | |
| ORDER BY countryLong |
When I run with the list as a variable I get an error, Invalid Syntax near 'US'
(CF8 - MS SQL2005)
Thanks
Mark
