This one is driving me crazy...
The problem is that the variable #select_dnis_count.dnis# only changes in
one of the queries in the loop. Any help is appreciated.
Marcus
<CFQUERY NAME="select_dnis_count" DATASOURCE="#mainDSN#">
select dnis
from dbo.dnis_list
where account_code = '#trim(session.account_code)#'
</cfquery>
<CFQUERY NAME="select_ac_count" DATASOURCE="#mainDSN#">
select dbo.area_code_list.Area_code
from dbo.area_code_list
where account_code = '#trim(session.account_code)#'
</cfquery>
<cfset counting = 0>
<cfset myarray = arraynew(2)>
<cfloop query="select_dnis_count">
<CFQUERY NAME="select_dnis" DATASOURCE="#mainDSN#">
SELECT dbo.dealer_info.Dealer_name,
dbo.tollfree_dnis_vanity.tollfree_number,
dbo.tollfree_dnis_vanity.vanity
FROM dbo.dealer_info,
dbo.tollfree_dnis_vanity
WHERE (dbo.dealer_info.Acct_code ='#trim(session.account_code)#')
AND (dbo.tollfree_dnis_vanity.dnis ='#select_dnis_count.dnis#')
<--- It changes
here --->
</CFQUERY>
<cfset counting= #counting# +1>
<cfset myarray[#counting#][1] = "#select_dnis.Dealer_name#">
<cfset myarray[#counting#][2] = "#select_dnis.tollfree_number#">
<cfset myarray[#counting#][3] = "#select_dnis.vanity#">
<cfset myarray[#counting#][4] = "">
<cfset myarray[#counting#][5] = "">
<cfset myarray[#counting#][6] = "">
<cfset myarray[#counting#][7] = "">
<cfset myarray[#counting#][8] = "">
<cfset myarray[#counting#][9] = "">
<cfloop query="select_ac_count">
<cfquery name="calls_by_date" datasource="#secondDSN#"
dbtype="ODBC"
debug>
SELECT start_time,
stop_time,
start_date,
Unnamed_3,
Unnamed_4
FROM time_log
WHERE Unnamed_3 = '#select_dnis_count.dnis#'
<--- But it never changes
here --->
AND (left(unnamed_4, 3)) =
'#trim(select_ac_count.area_code)#'
</cfquery>
<cfloop query="calls_by_date">
<cfset counting= #counting# +1>
<cfset myarray[#counting#][1] =
"#select_dnis.Dealer_name#">
<cfset myarray[#counting#][2] =
"#select_dnis.tollfree_number#">
<cfset myarray[#counting#][3] = "#select_dnis.vanity#">
<cfset myarray[#counting#][4] =
"#calls_by_date.start_time#">
<cfset myarray[#counting#][5] =
"#calls_by_date.stop_time#">
<cfset myarray[#counting#][6] =
"#calls_by_date.start_date#">
<cfset myarray[#counting#][7] =
"#calls_by_date.Unnamed_3#">
<cfset myarray[#counting#][8] =
"#calls_by_date.Unnamed_4#">
<cfset myarray[#counting#][9] =
"#calls_by_date.recordcount#">
</cfloop>
</cfloop>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists