Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/68807?pagenum=1
05 November 2025, 03:14
Topic
Jorrit787
Query help
26 July 2009, 13:12
I have a table in my Access DB that contains a field with lists of comma-delimited usergroup IDs. How can I select only those records in which the usergroup ID of the current user does not appear in the list of usergroup IDs in the database?
Something like this doesn't work:
SELECT * FROM TABLE WHERE " & m_usergroup & " NOT IN exclude_usergroups"
m_usergroup in this case could be "4", and a particular record could have an exclude_usergroups field value of "1,2,5,6".
Replies ...
ruirib
26 July 2009, 16:21
What is the table that has the usergroups to be exclused?
HuwR
26 July 2009, 16:33
you need to do
SELECT * FROM TABLE WHERE '" & m_usergroup & "' NOT IN exclude_usergroups"
Jorrit787
28 December 2009, 00:07
So, late response, but better late than never, right?
I tried your suggestion Huw, but I get this error:
Code:
Microsoft JET Database Engine error '80040e14'
In operator without () in query expression 'sectionid=103 AND '0' NOT IN usergroup'.
HuwR
28 December 2009, 02:38
try SELECT * FROM TABLE WHERE '" & m_usergroup & "' NOT IN (exclude_usergroups)"