Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Query help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 26 July 2009 :  13:12:12  Show Profile  Visit Jorrit787's Homepage  Reply with Quote
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".

eXtremeGossip

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 July 2009 :  16:21:45  Show Profile  Reply with Quote
What is the table that has the usergroups to be exclused?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20611 Posts

Posted - 26 July 2009 :  16:33:22  Show Profile  Visit HuwR's Homepage  Reply with Quote
you need to do

SELECT * FROM TABLE WHERE '" & m_usergroup & "' NOT IN exclude_usergroups"
Go to Top of Page

Jorrit787
Average Member

Netherlands
681 Posts

Posted - 28 December 2009 :  00:07:43  Show Profile  Visit Jorrit787's Homepage  Reply with Quote
So, late response, but better late than never, right?

I tried your suggestion Huw, but I get this error:

Microsoft JET Database Engine error '80040e14'

In operator without () in query expression 'sectionid=103 AND '0' NOT IN usergroup'.

eXtremeGossip

Edited by - Jorrit787 on 28 December 2009 00:07:58
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20611 Posts

Posted - 28 December 2009 :  02:38:46  Show Profile  Visit HuwR's Homepage  Reply with Quote
try
SELECT * FROM TABLE WHERE '" & m_usergroup & "' NOT IN (exclude_usergroups)"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07