>I'm writing a calendar that will contain sales data. I run a query against >that database to return all of the data for a given month, and then as I >loop through that resultset and build the calendar, I run a query of queries >against the DB query to return the data for that day. > > [stuff removed] > >The problem is that the "totalAmount" value for that query is only returning >the value for the first record, 43.41
Most likely it is the time stamps in the date fields. Aggregate functions like SUM() group on unique values of the fields in the GROUP BY expression, and each of the date/time stamps in your example query are unique. You can remove the date columns from the QoQ SELECT list and just group by DOY or truncate the time stamp from the dates before grouping. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274701 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

