write a query to find names not entered

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buddyr
    New Member
    • Apr 2007
    • 105

    write a query to find names not entered

    Hello,
    will try to explain.
    i have 4 employees.
    jim, jack, joe, and john.
    every week a report is created that needs to have one record from each of them.
    But they are not responsible and may forget to submit data.
    first week
    Table1
    name endDate
    Jim 2/6/10
    Joe 2/6/10
    John 2/6/10
    * Jack forgot to turn in his report*
    Is there anyway to find this out with a query? sql statement?

    you may say -you can see easy with 4 records - who is missing-

    but with 50 names and if it was 49 entries it will take longer to find name not there.
    I am able to count the records and display on report -
    but I am being asked to provide names of people not on report

    Does anybody know if this can be done in a query?
    also any helpfull advice to solve this will be helpfull - using my example to go from
    thank you
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Let's assume that you have a Table named tblEmployees with a [Name] Field. This Table consists of the Unique Names of all your Employees. You already indicated that Table1 contains a [Name] Field, so to find all Employees listed in tblEmployees who are not in Table1 (the Data Source of the Report):
    Code:
    SELECT tblEmployees.Name
    FROM tblEmployees LEFT JOIN Table1 ON tblEmployees.Name = Table1.Name
    WHERE Table1.Name Is Null;
    P.S. - This is a very simplistic approach which does not take into consideration typographical errors in entering the names and the like.

    Comment

    • buddyr
      New Member
      • Apr 2007
      • 105

      #3
      this is very simplistic answer for you- but for me its a gold mine- thank you- been having a stumbling block on this

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        You are quite welcome.

        Comment

        Working...