Hi,Being ignorant I just tried to write a query with an IN clause that looked like this:and cv.criteriaId in (select valueId from #locations)
SQL Server accepted this as valid and ran the query, returning no results.However if I rewrite the query manually with the thirteen or so numbers that that query produces, like this:and cv.valueID in (1001, 7600, 7601, 7602, 7603, 7604, ..etc..)
It runs fine and produces what I need.How can I write my subquery so that the whole query produces the value set I'm expecting?Cheers,Matt