I need to be able to relate a varchar field that contains a list of id numbers (eg: 3,4,7,89,203) to a category id field (int). I've tried ::
C.category_id IN (SELECT mID = CAST ( M2.member_category as INT)
FROM member_details M2 WHERE M2.member_id = M.member_id)
It returns this rather understandable error ::
'Syntax error converting the nvarchar value '7,3,2' to a column of data type int.'
I would definitely like to find a way of doing this via one query rather than a looping subquery via CF. Any help would be greatly appreciated.
Mark
C.category_id IN (SELECT mID = CAST ( M2.member_category as INT)
FROM member_details M2 WHERE M2.member_id = M.member_id)
It returns this rather understandable error ::
'Syntax error converting the nvarchar value '7,3,2' to a column of data type int.'
I would definitely like to find a way of doing this via one query rather than a looping subquery via CF. Any help would be greatly appreciated.
Mark