Hi

I need to do some reporting on orders from a web site, the table structure is 
as follows;

wp_products {ID: wp_products_id JOINED TO wp_products ON 
ga_product_templates.wp_product_template_id=wp_products.wp_product_template_id}

ga_product_templates{ID:gp_id; JOINED TO wp_products ON 
wp_products.wp_product_template_id=gp_product_templates.gp_id}

ca_order_items{ID:ca_orderitems_id; JOINED TO wp_products ON 
ca_order_items..ca_orderitems_product_id=wp_products.wp_products_id}

<cfquery name="get_orders" datasource="#application.dsn#">
SELECT ca_order_items.*, wp_products.*, gp_product_templates.*
FROM ca_order_items INNER JOIN (gp_product_templates INNER JOIN wp_products ON 
gp_product_templates.gp_id = wp_products.wp_product_template_id) ON 
ca_order_items.ca_orderitems_product_id = wp_products.wp_products_id
ORDER by gp_name
</cfquery>

(please note using .* for testing only)

I need to display the sales information per product e.g Product One: Sold 5 
Total: £500, Product Two: Sold 2 Total £350

I was thinking of using queries of queries but how do I get the individual 
product totals, apposed to the total of all the rows, etc. Do I need to loop 
around my first query, set a variable add it together and display to screen? 

Any ideas on the best way to approach this?

Thank you

Jason


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320507
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to