Showing employees with null values

D

Dos Equis

I have 10 employees. Of those 10, I have an action taken by 3 of them
which must be documented and counted for number of occurences per
week. How do I make a report which documents ALL employees and
indicates a number of occurences for only those employees the action
applies to? I am looking for results which resemble this:


Jim Brown 2
James Mercer 0
Harry Genes 0
Ema Tard 8
Jimmie Barre 1
Adam Aims 0


All numbers indicate an action which has been counted, all 0's
indicate these employees have not taken this action.

Any help would be greatly appreciated and I can explain further if
required.

Thanks,

Byron
 
D

Damian S

Hi Byron,

To achieve this, you need to use a left join not an inner join, like this:

select EmployeeName, count(ItemID) from
tblEmployee left join tblItem on tblEmployee.EmployeeID = tblItem.EmployeeID
group by EmployeeName

Hope this helps.

Damian.
 
D

Dos Equis

Hi Byron,

To achieve this, you need to use a left join not an inner join, like this:

select EmployeeName, count(ItemID) from
tblEmployee left join tblItem on tblEmployee.EmployeeID = tblItem.EmployeeID
group by EmployeeName

Hope this helps.

Damian.








- Show quoted text -

Aside from I should have worked that out, I've been working on it for
weeks. Thank You! Worked perfectly.

Byron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top