When you loop through 2 queries like this, when you refernce a row in the outer query from inside the inner query it will always use the first row! This is a known feature in CF.

You can either set local variables:
<cfloop query="GetExample">
<cfset this_kod_gt = GetExample.kod_gt>
<cfloop query="translation_list">
  <cfif this_kod_gt eq translation_list.dept_code>

or use the array notation to explicitely reference the row:

<cfloop query="GetExample">
<cfset outerloopRowNum = GetExample.currentrow>
<cfloop query="translation_list">
  <cfif GetExample.kod_gt[outerloopRowNum] eq translation_list.dept_code>

HTH
Bert

ps in the secind example its possible you don't need to set a local var for the current row, but i can't check right now...

-----Original Message-----
From: YC Nyon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 11:44 AM
To: CF-Talk
Subject: Nested CFLoop problem

I can't seem to make the 1st loop to move to the next record. Am I missing
something? Below is the code snippet.

<cfloop query="GetExample" startrow="1"   endrow="#GetExample.recordcount#">
<cfloop query="translation_list"   startrow="1"
endrow="#translation_list.recordcount#" >
  <cfif GetExample.kod_gt eq translation_list.dept_code>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to