Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report to lookup value not in database

Status
Not open for further replies.

rubberhead10

Technical User
Sep 13, 2006
49
US
hello all,

I need to design a report that would look for an employee that has missed a certain training class.

I am using access 2007 and have the following tables tblemployeeInfo that has fields empID, empname, empgender and the table tblClassAttendance that has fields empid, className, classdate.

the problem I am having is that if an employee did not go to the class then there is not an entry in the tblclassattendance for the class. how would I set the report up to look for entries that are not there.....thanks
 
Too easy mate, consider:

SELECT tblemployeeInfo.empID, tblemployeeInfo.empname, tblclassattendance.empID
FROM tblemployeeInfo LEFT JOIN tblclassattendance ON tblemployeeInfo.empID=tblclassattendance.empID
WHERE (((tblclassattendance.empID) Is Null));
 
THANKS......IT looks great. I put it into the query but it gives me an error "Check the subquery's syntax and enclose the subquery in parentheses"...I just copied and pasted the query from what you typed........Thanks so much for your help
 
I just pasted it into a test session here and get no error. Have i spelt your table/field names correctly? If that checks out ok then use the query builder to visually create this SQL.

a) Add the two tables concerned, tblEmployeeInfo and tblClassAttendance.

b) If a link doesn't automatically appear between the EmpID filed then use the mouse to drag one to the other.

c) Double click the link you've just create and choose the option "List ALL records from tblEmployeeInfo and only those from tblClassAttendance when related info exists"

d) add the fiels from tblEmplyeeInfo you wish to see.

e) Add the field EmpID from tblClassAttendance and add the criteria "Is null"

Let me know how you go. Curious error.
 
Thanks it works perfectly......I uses the query builder and had no error.......thanks so much for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top