Got it, thanks. 
CreateODBCDate was added and poof.

Sometimes the simplest....doh!



-----Original Message-----
From: Gaulin, Mark [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 26, 2005 12:28 PM
To: CF-Talk
Subject: RE: Puzzled...

That GROUP BY may not be what you want... It will collapse all records
where the qty's are the same into one record. 

-----Original Message-----
From: Eric J. Hoffman [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 26, 2005 1:02 PM
To: CF-Talk
Subject: Puzzled...

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:207780
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

Reply via email to