Try this assuming you have integer values in the id_subweb field.
Run your first query. Skip converting the sublist. Skip the cfloop. Then
run this query.
<cfquery name="GetRolloverDetails" datasource="#dsn#">
SELECT *
FROM mkt_rollovr_subweb_ref
WHERE id_subweb in (#valuelist(getsubweb.id_subweb)#)
</cfquery>
Then output the GetRolloverDetails Query. The way you are doing it, each
time through the loop you are overwriting the query.
Hope this helps.
DC
----- Original Message -----
From: "Rosa, Issac" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 19, 2000 20:41
Subject: Query result in another query
> Here's what I'm trying to accomplish.
>
> I am querying a table that will give multiple values for a field (e.g. id
=
> 9,4). I need to then use these ids to run another query.
>
> Here's my current code that does not generate an error, but does not run
the
> query more than once and only outputs the first ids data. Any thoughts or
> suggestions would be greatly appreciated.
>
> This query returns 9 and 4 as id_subweb
> CFQUERY NAME="GetSubweb" DATASOURCE="#dsn#">
> SELECT id_view, id_subweb
> FROM mom_category_views
> WHERE username = '#session.username#'
> </cfquery>
>
> <CFSET subList=ListToArray(#GetSubweb.id_subweb#, ",")>
>
> <cfloop index=i from=1 to=#ArrayLen(subList)#>
> <cfquery name="GetRolloverDetails" datasource="#dsn#">
> SELECT *
> FROM mkt_rollovr_subweb_ref
> WHERE id_subweb = #subList[i]#
> </cfquery>
> </cfloop>
>
> <cfoutput query="GetRolloverDetails">
> #mission_statement# <br>
> </cfoutput>
>
>
> If you have any questions or concerns, please feel free to call me at
> 407-514-5021.
>
> Thank you,
>
> > Issac Rosa
> >
> > IT - National Sales & Marketing
> > OLAP Specialist Team Leader
> > Ofc: 407-514-5021
> > Cell: 407-342-0644
> > Fax: 407-514-5988
> > [EMAIL PROTECTED]
> >
> --------------------------------------------------------------------------
----------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send
a message with 'unsubscribe' in the body to
[EMAIL PROTECTED]
>
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]