Huh? Ya got me with that one Mark. Care to explain in detail? Also, would it
be easier to use CF to insert the missing hours of the day and values of
zero (if yes, what would be the easist)? I hate to use CF when I might be
able to use the db... but were only talking about 24 rows of data.

~Che

-----Original Message-----
Che, try this, create a table 1 row and the numbers 0 through 23 in them,
then do
a left join to your group by query :)

-Mark

-----Original Message-----
SELECT Datepart(hh,OrderDate) AS Hour, Count(OrderDate) AS
TotalOrdersPerHour
FROM    Orders
WHERE   Status = 'SHIPPED' AND (OrderDate BETWEEN '8/1/2005' AND '8/31/2005
23:59:59')
GROUP BY Datepart(hh,OrderDate), Datepart(hh,OrderDate)
ORDER BY Datepart(hh,OrderDate) ASC


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216477
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to