I wrote a simple query that counts the the number of docments given a specific peroid in a sql database. The query works. It lists the document categories and then gives me a count for each one. Please see below. I am trying to expand the query to list the document categories but break down by user. My current query gives me results such as the following.
Document1 3
Document2 7
I want the results to look like the following:
Mike Smith Document1 2
Bob Jenss Document1 1
Mike Smith Document2 4
Bob Jenss Document2 3
The Column name is CreateUserID. I assume I need another "group by", but I could be wrong. I cannot get the syntax correct. I would greatly apperciate any help.
Select DocumentCategory, Count(*) As DocumentCount
from tblCsDocument
where EnterDate between Convert(datetime, '2014-01-01') and Convert(datetime, '2014-12-31')
group by DocumentCa