Results 1 to 2 of 2
  1. #1
    hascons is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    9

    Left Join Problems


    Hello,

    I thought I had solved this Problem from another post but I overlooked something and now it's causing some grief.

    I'm trying to return left table values where there are no matching records in the right table. The following code works to accomplish this if the data is not updated.

    Code:
    SELECT [Employees Extended].EmployeeID, [Employees Extended].[Employee Name], [Employees Extended].RateClassID, [Employees Extended].TradeID, [Employees Extended].State, [Time Card Entry].Dateworked
    FROM [Employees Extended] LEFT JOIN [Time Card Entry] ON [Employees Extended].EmployeeID = [Time Card Entry].EmployeeID
    WHERE ((([Employees Extended].DateTerminated) Is Null) AND (([Time Card Entry].TimeCardID) Is Null) 
    ORDER BY [Employees Extended].[Employee Name];

    However because the data from the right table continuously updates weekly from the table on the left I always get blank data back from running the query. I tried to add a filter to only return the current data from the right table but i still end up with blank data. Below is the same code above with the addition of another filter to use current data.

    Why won't this work?
    Are there too many filters for a left join?

    Code:
    SELECT [Employees Extended].EmployeeID, [Employees Extended].[Employee Name], [Employees Extended].RateClassID, [Employees Extended].TradeID, [Employees Extended].State, [Time Card Entry].Dateworked
    FROM [Employees Extended] LEFT JOIN [Time Card Entry] ON [Employees Extended].EmployeeID = [Time Card Entry].EmployeeID
    WHERE ((([Employees Extended].DateTerminated) Is Null) AND (([Time Card Entry].TimeCardID) Is Null) AND (([Time Card Entry].Dateworked)>#4/6/2014#))
    ORDER BY [Employees Extended].[Employee Name];
    Any help would be greatly appreciated, I just can't seam to find any information on this type of join with multiple where statements

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If you are curious why some null fields are still being retrieved, try the OR operator vs. the AND operator.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Left join problem
    By therzakid in forum Access
    Replies: 24
    Last Post: 03-22-2014, 03:51 PM
  2. Inner Join works but not Left Join
    By kwooten in forum Queries
    Replies: 1
    Last Post: 12-11-2012, 05:09 PM
  3. Left Join not
    By j_a_monk in forum Queries
    Replies: 5
    Last Post: 08-07-2011, 09:47 AM
  4. inner, left or right join ?
    By toqilula in forum Access
    Replies: 0
    Last Post: 04-11-2011, 12:20 AM
  5. Replies: 3
    Last Post: 02-02-2011, 01:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums