finding out absentees

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am finding out records of all employees present on a perticular date using
the fields [FK_Emp_Id] and [Date].The table tblDaily_Attendance stores the
records of all employees who are present. How do I write the query to find
"All employees who were not present on that date " . I don't have any field
seperately for finding out attendance status of an employee whether present
or absent. Should I have one or can I manage without this field?
OR should I take a seperate table to store whether an employee is present or
absent on a perticular date?
 
This example assumes that you have a tblEmployee table with Emp_Id as the
primary key ...

SELECT Emp_Id FROM tblEmployee WHERE Emp_Id NOT IN (SELECT FK_Emp_Id FROM
tblDaily_Attendance WHERE [Date] = [Date?])

BTW: 'Date' is a reserved word, and best not used as a field or control
name.
 
Thanks Brendan, not only did you give the solution for my problem but also
gave an important info. that reserved words should not be taken as field
names. :)

-------------
Anand Vaidya
I''m here to know.


Brendan Reynolds said:
This example assumes that you have a tblEmployee table with Emp_Id as the
primary key ...

SELECT Emp_Id FROM tblEmployee WHERE Emp_Id NOT IN (SELECT FK_Emp_Id FROM
tblDaily_Attendance WHERE [Date] = [Date?])

BTW: 'Date' is a reserved word, and best not used as a field or control
name.

--
Brendan Reynolds
Access MVP

Anand Vaidya said:
I am finding out records of all employees present on a perticular date
using
the fields [FK_Emp_Id] and [Date].The table tblDaily_Attendance stores the
records of all employees who are present. How do I write the query to find
"All employees who were not present on that date " . I don't have any
field
seperately for finding out attendance status of an employee whether
present
or absent. Should I have one or can I manage without this field?
OR should I take a seperate table to store whether an employee is present
or
absent on a perticular date?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top