Skip to main content
Participant
October 16, 2007
Question

Filtering RS using IN statement and cookie value

  • October 16, 2007
  • 1 reply
  • 271 views
Scenario: Users of the site are to be presented with menu items that are relative to their customer group which I'm pulling from their customer details. User logs in, cookie is written to identify customer and menu categories.


I'm trying to filter a recordset that I'm using to display categories for the menu using an IN statement with the values being pulled from a string in a cookie that looks something like (1,2,4,7,9,11) (& i've also tried it formatted like ('1','2','4','7','9','11').

My cookie is written like ("keyuser") ("defaultmenu") where "defaultmenu" contains the string I'm trying to use for the IN statement

My SQL looks like this:

SELECT *
FROM dbo.CatGroups
WHERE catid IN (MMColParam)
ORDER BY ParentGroup ASC

Runtime value = request.cookies("keyuser") ("defaultmenu") - The value I'm pulling in looks like this ('1','2','4','7','9','11')
Type = Text


My recordset brings back absolutey nothing!!

Has anyone done anything like this with using an IN statement or should I consider something else. Spent an afternoon playing but getting nowhere slow!!

Any help appreciated.

cheers

Julian Parkinson
This topic has been closed for replies.

1 reply

Participant
October 16, 2007
I just used <% =(RSCatGroups.Source) %> to display the sql - it looks like the token I'm using mmcolparam (where the ? is) doesn't quite work. Can anyone suggest the sytax for this?

SELECT * FROM dbo.CatGroups WHERE (catid IN (?))