Thanks- that works. I had all my queries listed together on a separate
page- I hate when I make those basic mistakes....
However, this leads to another problem and I don't know if it's fixable.
To test the solution I only added one other query (so there's four more to
go) and it slowed the process down considerably.... Do you see any way
around this?
-----Original Message-----
From: Greg Luce [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 9:36 AM
To: CF-Talk
Subject: RE: CFOUTPUT Challenge
Janine,
I don't know if I understand your situation completely, but if
your main CFOUTPUT returns a resultset of "customers", then you want 5
other queries regarding that customer, you can run those queries inside
the main CFOUTPUT and loop over the results of each query. Something
like this:
<CFOUTPUT QUERY="1" GROUP="CustomerID">
#NAME#, #ADDRESS#
<CFQUERY name="2">
SELECT *
FROM orders
WHERE customer_id = #1.customer_id#
</cfquery>
<CFLOOP query="2">
#2.Order1# #Order2#
</CFLOOP>
<CFQUERY name="3">
SELECT *
FROM some_other_table
WHERE customer_id = #1.customer_id#
</cfquery>
<CFLOOP query="3">
#3.Order1# #Order2#
</CFLOOP>
</CFOUTPUT>
Or it sounds like you possibly could join all 6 tables in a query. Let
me know if the looping way works.
Greg Luce
954-763-4504
-----Original Message-----
From: Janine Jakim [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 8:41 AM
To: CF-Talk
Subject: CFOUTPUT Challenge
I have what I consider an interesting problem.
I need to send the results of 6 queries out to make one form.
(report/pdf
style).
My main query- person demographic query works great and opens up the
correct
number of reports (1 report per person). However, the other 5 queries
only
give the information for the 1st person. I realize this is because of
the
cfoutput of the main query vs subqueries.
For example
<CFOUTPUT QUERY="1" GROUP="CustomerID">
#NAME#, #ADDRESS#
<CFOUTPUT>
#Orders.Order1# #Order2#
</CFOUTPUT>
</CFOUTPUT>
I don't think qofq is the answer because of the amount of the queries
(6)
and the way they are handled. (Some of the queries do not have a direct
link
to the 1st query)
I have tried:
-Leaving out the 2nd cfoutput statement- that results in all the
customers
having the same orders.
- Adding a <CFIF> statement for the 2nd output statement-
<CFIF 1.CustomerID EQ Orders.CustomerID>
<CFOUTPUT>- this results in only the 1st persons order information
showing
up.
-<CFLOOP LIST> with and without the cfif statement. Same results as
above..
I can not change it to:
<CFOUTPUT QUERY="1" GROUP="CustomerID">
#NAME#, #ADDRESS#
</CFOUTPUT>
<CFOUTPUT>
#Orders.Order1# #Order2#
</CFOUTPUT>
This causes only 1 form to show up.
I'm stumped on how to do this....Does anyone have any ideas....certainly
I
am not going "where no man has ever gone before"
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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