You are here: Two Tables with Left Outer Join & Where Clause « MsSQL Server « IT news, forums, messages
Two Tables with Left Outer Join & Where Clause

Posted by pbassutti on 10/29/07 06:44

Hello,

I'm trying to link two tables... one for Employees and the other for
Timecards

I need to get a list of employees that do not have timecards on an
SPECIFIC DATE

I tried the follonwing

SELECT Employess.EmployeeID
FROM Employees LEFT OUTER JOIN Timecards on Employees.EmployeeID =
Timecards.lmpEmployeeID
WHERE lmpEmployeeID is NULL and lmpTimecardDate = '10/24/2007'

But it doesn't work. However, when I comment the date condition out
(lmpTimecardDate = '10/24/2007') it works all right but It's not what
I need

Another interesting point... if I use the following query... it works
all right

SELECT Employess.EmployeeID
FROM Employees
WHERE Employees.EmployeeID not in (select Timecards.EmployeeID from
Timecards
where TimecardDate = '10/24/2007')

I'd like to be able to use the Left Outer Join option.... Am I doing
something wrong?... or is it that if It doesn't like the condition I'm
usgin in the WHERE clause (TimecardDate = '10/24/2007')

Thanks for your help

Pablo

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация