Tammy,
First, use "arrayResize( )" to kill the first loop code:
<cfset NullArray = ArrayNew(1)>
<cfset Temp = ArrayResize(qryGetOnlineApps.Recordcount)>
Then, use the query array syntax to grab the data you want from the second
(offlineApps) query ... like so:
CFLOOP query="qryGetOnlineApps"> <CFSET Dummy=
QuerySetCell(qryGetOnlineApps,"OfflineApps",qryGetOfflineApps[currentrow].To
talOfflineAp,CurrentRow)>
</CFLOOP>
Of course I'm assuming that the second query has at leas as many rows as the
first query. Either that - or you should be running a query inside your loop
like this:
<CFLOOP query="qryGetOnlineApps">
<cfquery name="Get" datasource="myDsn">
SELECT COUNT(offlineApps) AS totalOfflineAp
FROM ApsTable
WHERE Apname = '#someValueFromYourQryGetOnlineAppsQuery#'
</cfquery>
<CFSET Dummy=
QuerySetCell(qryGetOnlineApps,"OfflineApps",qryGetOfflineApps.TotalOfflineAp
,CurrentRow)>
</CFLOOP>
In this case you are grabbing relevant data on the fly. AS an aside, and
assuming your are simply gather data about your site and not displaying it,
you should consider CF 5's "query of a query" to make a join - seems like a
good place for it.
Mark
-----Original Message-----
From: Tammy Hong [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 11:48 AM
To: CF-Talk
Subject: Problem with QuerySetCell
Hi,
I am trying to add the values from a second query to my first query but for
some reason it is setting all rows to the first value of the query. Can
someone tell me what I did wrong? TIA.
<CFSET NullArray = ArrayNew(1)>
<CFLOOP INDEX="Row" FROM="1" TO="#qryGetOnlineApps.RecordCount#">
<CFSET NullArray[#Row#] = "0">
</CFLOOP>
<CFSET Dummy = QueryAddColumn(qryGetOnlineApps,"OfflineApps",NullArray)>
<CFLOOP query="qryGetOnlineApps"> <CFSET Dummy=
QuerySetCell(qryGetOnlineApps,"OfflineApps",qryGetOfflineApps.TotalOfflineAp
p,qryGetOnlineApps.CurrentRow)>
</CFLOOP>
Tammy
_________________________
_________________________
____________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB
MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists