If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Please help to give outer join instead of inner join
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 |
#2
|
|||
|
|||
Please help to give outer join instead of inner join
Hi pol,
What i would normally do is change the FROM statement to the following: FROM employee left join holiday on Holiday.employeeid = employee.recordid and obviously drop this from the WHERE statement Hope this helps... W -- The Psyber Fox http://www.psyberconsulting.co.za "pol" wrote: 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 |
#3
|
|||
|
|||
Please help to give outer join instead of inner join
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 pol wrote: 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 |
Thread Tools | |
Display Modes | |
|
|