Hi all- Have run into a little hiccup and wondering if anyone has any ideas...Basically I have a function to proximity search by zip code and that returns a varchar(max) of a list of zips in this form:'35004','35007','35013','35014','35015'The problem occurs when I try and check if a postalcode is in that list... if I add this to my where clause it returns no results:declare @zipCodesWithinProximity varchar(max)SET @zipCodesWithinProximity = dbo.fnct_FindNearby2(@clubZip,@proximity)...WHERE (ca.postalcode IN (@zipCodesWithinProximity))
I've been able to get it to work with dynamic sql, but would like to avoid that if possible to not have the performance hit. Here's the dynamic that works: IF @courseZip != '' BEGIN IF @Where = '' SET @Where = ' WHERE ' ELSE SET @Where = @Where + ' AND ' SET @Where = @Where + 'fa.PostalCode IN (' + dbo.fnct_FindNearby2(@courseZip,@proximity) + ')' ENDAny ideas? I'm stumped... thanks for whatever help you can give.