Hi guys I'm in urgent need of help.
I have a column in my table that collects lists(UserGroup), but I want to compare individual list items in Usergroup(Qry1) with individual list items in UserGroup(Qry2).
<CFQUERY NAME="Qry1" DATASOURCE="#db#">
SELECT UserID, UserGroup FROM users
WHERE usersid = #SESSION.userID#
</CFQUERY>
<CFQUERY NAME="Qry2" DATASOURCE="#db#">
SELECT UserID, UserGroup FROM users
WHERE usersgroup IN (#Qry1.usergroup#)
</CFQUERY>
What I am trying to do is compare individual list items in usergroup with each other thus why the sql IN function will not work.
Example
if Qry1 Usergroup equals 21, 15,17
and Qry2 Users/Usergroup:
John 13,15,12
Peter 20,19,14
Sarah 20,12,17
Then John and Sarah will be retrieved by Qry2
Pleasae, any help will be very much apreciated