Returning Null vaules in a count

Workaholic

Registered User.
Local time
Today, 11:44
Joined
Jun 20, 2004
Messages
17
I have a query that counts how many calls an internal company helpdesk recieves and from which of the company office they come from. Each call is given an unique ID and my query counts the call ID's and links them to the office they originated from. My problem is that I want to display offices that have made no calls but my query will only list the call count of offices that have made calls.

How do I include null values in the count if I also have to critera the call count?
 
Works until criteria is added.

Thanks that worked but only until I added criteria. When I asked for only calls made in 2004 it failed. See below


SELECT Count(dbo_helpdesk_calls.ID) AS CountOfID, dbo_helpdesk_offices.office_name
FROM dbo_helpdesk_calls LEFT JOIN dbo_helpdesk_offices ON dbo_helpdesk_calls.office = dbo_helpdesk_offices.ID
WHERE (((DatePart("yyyy",[dbo_helpdesk_calls].[date_raised]))=[Enter Year]))
GROUP BY dbo_helpdesk_offices.office_name
ORDER BY dbo_helpdesk_offices.office_name;
 
Ok I got you but how do you then include that query in a query where you are determing selection criteria?
 
The same way you would with a table - select it in the query design window.
 
Yeah but when I add the criteria in the table it only returns the offices that have made calls. It does not show the '0's' of the offices that have not made any calls.
 

Users who are viewing this thread

Back
Top Bottom