Please help to give outer join instead of inner join

P

pol

I want to list all the employees from employee eventhough not existing in
holiday

SELECT
employee.company,
employee.recordid,
employee.employee,
employee.holsallow,
employee.hrs_holiday,
Holiday.datefrom,
Holiday.dateto,
Holiday.descr,
Holiday.ho_hrs,
Holiday.ho_mts,
FROM employee,
Holiday
WHERE ( Holiday.employeeid = employee.recordid )
order by Holiday.employeeid, Holiday.datefrom

Please help

With thanks
Pol
 
J

John Spencer

SELECT
employee.company,
employee.recordid,
employee.employee,
employee.holsallow,
employee.hrs_holiday,
Holiday.datefrom,
Holiday.dateto,
Holiday.descr,
Holiday.ho_hrs,
Holiday.ho_mts,
FROM employee LEFT JOIN Holiday
ON (Holiday.employeeid = employee.recordid )
ORDER BY Holiday.employeeid, Holiday.datefrom

OR you might try the following

SELECT
employee.company,
employee.recordid,
employee.employee,
employee.holsallow,
employee.hrs_holiday,
Holiday.datefrom,
Holiday.dateto,
Holiday.descr,
Holiday.ho_hrs,
Holiday.ho_mts,
FROM employee,
Holiday
WHERE Holiday.employeeid = employee.recordid
OR employee.recordid is Not Null
order by Holiday.employeeid, Holiday.datefrom

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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