Need to display all names, even those with no entries

D

DANANDLEA

I have created a small database to track overtime. I have a table set
up for employee information, one for entry of overtime (which happens
via a form). I need to create a report that lists all employees by
shift, regardless if they have worked overtime or not, but include the
sum of overtime for those that have worked. I can currently only
query those that have worked - any way around this?
 
O

obriend

SELECT Sum([TIME WORKED].[HOURS WORKED]) AS [SumOfHOURS WORKED],
[Employee list].NAME
FROM [Employee list] INNER JOIN [TIME WORKED] ON [Employee list].ID =
[TIME WORKED].ID
GROUP BY [Employee list].NAME
ORDER BY Sum([TIME WORKED].[HOURS WORKED]);
 
G

Guest

Change your INNER JOIN to a LEFT JOIN
--
Dave Hargis, Microsoft Access MVP


obriend said:
SELECT Sum([TIME WORKED].[HOURS WORKED]) AS [SumOfHOURS WORKED],
[Employee list].NAME
FROM [Employee list] INNER JOIN [TIME WORKED] ON [Employee list].ID =
[TIME WORKED].ID
GROUP BY [Employee list].NAME
ORDER BY Sum([TIME WORKED].[HOURS WORKED]);
 
O

obriend

THANK YOU VERY MUCH! THAT WAS SUCH A SIMPLE FIX

Change your INNER JOIN to a LEFT JOIN
--
Dave Hargis, Microsoft Access MVP



obriend said:
SELECT Sum([TIME WORKED].[HOURS WORKED]) AS [SumOfHOURS WORKED],
[Employee list].NAME
FROM [Employee list] INNER JOIN [TIME WORKED] ON [Employee list].ID =
[TIME WORKED].ID
GROUP BY [Employee list].NAME
ORDER BY Sum([TIME WORKED].[HOURS WORKED]);
 

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

Similar Threads


Top