COUNT(*) counts the number of rows in each GROUP BY group. If you do not have a GROUP BY clause, then the entire query is considered to be one big group, which is why COUNT(*) gives the number of rows in the query.
Thus, you want to GROUP by the date, as:
SELECT TheDate, COUNT(*) FROM table GROUP BY TheDate
To group by your expression, your query will be a bit ugly, as you will have to repeat the expression in both the SELECT and the GROUP BY clause:
Code:
SELECT CAST(CONVERT(CHAR(10), logDate, 101) as TheDate, COUNT(*) FROM Log
GROUP BY CAST(CONVERT(CHAR(10), logDate, 101)
ORDER BY TheDate
Note that you do not have to repeat the expression in an ORDER BY clause, as any column alias's are visible to the ORDER BY clause (but not the GROUP BY clause).
P.S. Don't use a datatype name such as 'datetime' as a column name - eventually you'll regret it.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com