Please help to give outer join instead of inner join

  • Thread starter Thread starter pol
  • Start date Start date
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
 
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
 
Back
Top