Ian,

You can nest CFOUTPUT for queries this way:  Don't specify the query name 
in any CFOUTPUT except the outermost one.  Use the GROUP attribute in all 
the CFOUTPUTs except the innermost one.  Here is one way to do it, grouping 
by the orderID field (or any field that has the same value for every record 
returned by your query)

Joy

<CFMAIL
TO="#Client.email#"
FROM="[EMAIL PROTECTED]"
SUBJECT="Your latest Order">
THIS SITE IS NOT LIVE. THE ORDER YOU PLACED WILL NOT BE PROCESSED.

<CFOUTPUT QUERY="getCompleteOrder" GROUP="orderID">
Order No. #orderID#:

Item Qty Net Price
-----------------------------------------------------------
<CFOUTPUT>
#LJustify(Title, 40)# #RJustify(itemQuantity, 3)#
#RJustify(NumberFormat((itemPrice * itemQuantity), "999,999.99"), 6)#
</CFOUTPUT>

Subtotal:
#netCost#
Tax: #tax#
Shipping: #shipping#
-------------------------------------
Total: #total#
</CFOUTPUT>
</CFMAIL>


At 06:55 AM 4/9/00 -0700, you wrote:
>Thanks for the suggestions.
>
>Here is what happens:
>
>If I put the Query attribute in the CFOUTPUT tag and remove it completely from
>CFMAIL, I get an error message that I am nesting queries which I can't do
>because only the top level can specify the query name. Since I am not even
>using the query attribute in CFMAIL this doesn't make sense.
>
>If I put the query attribute in a CFLOOP tag I get an error message that I
>have tried to use CFOUTPUT without a query attribute.
>
>Ian
>
><CFMAIL
>   TO="#Client.email#"
>   FROM="[EMAIL PROTECTED]"
>   SUBJECT="Your latest Order">
>   THIS SITE IS NOT LIVE. THE ORDER YOU PLACED WILL NOT BE PROCESSED.
>
><CFLOOP QUERY="getCompleteOrder">
><CFOUTPUT QUERY="getCompleteOrder">
>Item                                     Qty      Net Price
>-----------------------------------------------------------
>#LJustify(Title, 40)# #RJustify(itemQuantity, 3)#
>#RJustify(NumberFormat((itemPrice * itemQuantity), "999,999.99"), 6)#
></CFOUTPUT>
></CFLOOP>
><CFOUTPUT>
>                                                                     Subtotal:
>#getCompleteOrder.netCost#
>Tax:      #getCompleteOrder.tax#
>Shipping: #getCompleteOrder.shipping#
>
>-------------------------------------
>Total:    #total#
></CFOUTPUT>
></CFMAIL>
>
>____________________________________________________________________
>Get your own FREE, personal Netscape WebMail account today at 
>http://webmail.netscape.com.
>------------------------------------------------------------------------------
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebarsts&bodysts/cf_talk or send 
>a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to