Question
Filter Recordset
Using MS SQL and ASP VBScript. I have a table called
PRODUCTS, in this table there is a field called CATEGORIES. now the
CATEGORIES field contains comma separated values representing each
category it belongs to ie: 2,5,10,12. So in this example there are
4 categories this product belongs to. Now I need to filter a
recordset by category based on a single variable.
So if I click my link: mypage.asp?CatID=2, it should return all the records that have 2 in the CATEGORIES field.
I tried using the % wildcard but it would return 2, 12, 20, basically anything with a 2 in it which is not what I am looking for.
SELECT *
FROM PRODUCTS
WHERE CategoryID .......This is where I can't get it working.
any suggestions?
So if I click my link: mypage.asp?CatID=2, it should return all the records that have 2 in the CATEGORIES field.
I tried using the % wildcard but it would return 2, 12, 20, basically anything with a 2 in it which is not what I am looking for.
SELECT *
FROM PRODUCTS
WHERE CategoryID .......This is where I can't get it working.
any suggestions?