Hi, can someone give a hand for this:
I have dynamically expanded similar queries, so I would like to put in a
loop,
however, when I tried to create a array to store the query names, it seems
does not work, it may be just how to pass the queryname...
Any suggestion will be greatly appreciated.
----------------------------------------------------------------------
<cfscript>
cShip = ArrayNew(1);
cResult = ArrayNew(1);
for(k=1; k LTE 6; k=k+1)
{
cShip[k] = "cc" & k;
cResult[k] = 0;
}
</cfscript>
<cfoutput>
<cfloop from=1 to=6 index="k">
<cfquery name='#cShip[k]#' datasource="meimei" DBTYPE="Oracle80" >
select count(*) as total
from tblMei
where customer_name='xxx'
and part_number='xxxxxxx'
and ship_date <='mon[k]'
</cfquery>
<cfset cResult[k] ='#cShip[k]#'.total>
#cResult[k]#<BR>
</cfloop>
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists