Still can't figure out what is wrong with this query:
<cfquery name="getrow10" datasource="#request.dsn#">
Select
COUNT (customer_orders.id) as totqty,
SUM (customer_orders_prod.qty) as sumqty,
customer_orders_prod.qty
FROM customer_orders
LEFT OUTER JOIN customer_orders_prod on customer_orders.id =
customer_orders_prod.order_id
WHERE customer_orders.orderdate BETWEEN #start1a# AND
#DateAdd('D', 1, end1a)#
AND customer_orders_prod.product_id = 102
AND qty > 0
GROUP BY customer_orders_prod.qty
ORDER by customer_orders_prod.qty ASC
</cfquery>
It gets all data summed up rather than just for the records for the date
range. What am I doing wrong here?
Thanks,
Eric
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207771
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54