I can't remember offhand if QofQ allows the IN clause:

SELECT *
FROM q1
WHERE q1.pkey NOT IN ( #ValueList( q2.pkey )# ) 

Or you could do a more manual query:

SELECT * 
FROM q1
WHERE 1 = 1
<cfloop query="q2">
AND q1.pkey != #q2.pkey#
</cfloop>


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Peterson, Chris [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 05, 2007 10:08 AM
To: CF-Talk
Subject: RE: QoQ - remove all instances of value from Query1 in Query2?

And in case you are wondering why I have to use QoQ's, I am getting a
query set for users and for groups from Active Directory using CFLDAP,
and I then need to remove all the instances of users that are already
configured for access to the selected report, so I have available users
on the left, and configured users on the right. =)

Chris 

-----Original Message-----
From: Peterson, Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 10:05 AM
To: CF-Talk
Subject: RE: QoQ - remove all instances of value from Query1 in Query2?

Just a primary key (username or group name, I have 2 queries I need to
filter like this, one for users and one for groups) 

-----Original Message-----
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 10:01 AM
To: CF-Talk
Subject: RE: QoQ - remove all instances of value from Query1 in Query2?

What do you use to determine the match? An entire record must match? Or
just a primary key?
 

.........................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Peterson, Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 9:59 AM
To: CF-Talk
Subject: QoQ - remove all instances of value from Query1 in Query2?

I have 2 Query objects.  I need to remove all records from query 1 that
have a matching value in query 2, so I basically need to end up with a
query result set that has the contents of query 1 less the contents of
query 2.  Any idea's, other than a very manual loop with a check on each
value individually?  If this was SQL I would do a WHERE username NOT IN
(select username from Query2), but that does not work with QoQ.


Anyone know some tricks?

Chris Peterson









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274582
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to