This is one of a couple of things which was much easier to do in
primitive databases like dBase or Clipper.
But I would use an equivalent technique here, just looping in both
queries in the same time.
(not tested)
<CFQUERY NAME="q1" DATASOURCE="DS1">
SELECT field
ORDER BY field
</CFQUERY>
<CFQUERY NAME="q2" DATASOURCE="DS2">
SELECT field
ORDER BY field
</CFQUERY>
<CFSET index1 = 1>
<CFSET index2 = 1>
<CFLOOP CONDITION="index1 LTE DS1.recordCount OR index2 LTE
DS2.recordCount">
<CFIF index2 GT DS2.recordCount OR q2.field[index2] GT q1.field[index1]>
<!--- q1.field[index1] is a record in DS1 which is not in DS2:
do whatever you have to do with it, then skip to next record in DS1 --->
<CFSET index1 = index1 + 1>
<CFELSEIF index1 GT DS1.recordCount OR q1.field[index1] GT q2.field[index2]>
<!--- q2.field[index2] is a record in DS2 which is not in DS1:
do whatever you have to do with it, then skip to next record in DS2 --->
<CFSET index2 = index2 + 1>
<CFELSE>
<!--- both records are the same: skip to next in both DS --->
<CFSET index1 = index1 + 1>
<CFSET index2 = index2 + 1>
</CFIF>
</CFLOOP>
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294838
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4