Dave, below is my query...how would I make the query work with isnull() on SQL Server 2000? Thanks, Che.
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 Che, You can use isnull() in SQL Server and nvl() in Oracle. I don't know which DB you're using. Dave -----Original Message----- If have a query that returns a 24 hour breakdown of orders by the hour on a monthly basis. (see below). As you can see, Hour 5 & 6 are missing because there are no values to return. What would be the easiest way to add Hour 5 and Hour 6 to the query's recordset with a corresponding value of zero for each hour? The trick is, from month to month, the hours that have no values might change. Any idee-ers? Thanks, Che. HOUR TOTALORDERSPERHOUR 0 5 1 5 2 4 3 2 4 2 7 3 8 2 9 10 10 7 11 7 12 3 13 5 14 11 15 10 16 6 17 13 18 7 19 13 20 9 21 16 22 11 23 14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:216472 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