GROUP BY DATEPART(hour,SP1.TS) Did the trick
Thanks Ben. -----Original Message----- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, April 23, 2007 10:16 AM To: CF-Talk Subject: RE: Query to get avg pageviews per hour Can you just GROUP BY the HOUR() of the time? Then get the COUNT()... To get the average, it might then just be easier to divide that COUNT() by the day difference you put in. ....................... Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -----Original Message----- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Monday, April 23, 2007 11:12 AM To: CF-Talk Subject: Query to get avg pageviews per hour How might this query look? I feed it a datestart and datend and I would like to get back a list of values ordered by military time from 00:00 to 23:00. The db is SQL Server 2000. The only way I can think of doing it is to use a CASE statement, but that's quite elaborate. Anyone have an idea? ____________________________________ Andy Matthews Senior Coldfusion Developer Office: 877.707.5467 x747 Direct: 615.627.9747 Fax: 615.467.6249 [EMAIL PROTECTED] www.dealerskins.com <http://www.dealerskins.com/> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276065 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4