Jim Lawrence
accessd at shaw.ca
Fri Feb 10 03:09:55 CST 2006
One note: Would this query allow the user to go for coffee while waiting for the results? 'Sub queries' and 'not exists' has certain reputations? Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: February 8, 2006 7:04 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Basic Query Design On 8 Feb 2006 at 20:36, Steve Erbach wrote: > SELECT DISTINCT EmployeeID > FROM tblEmployeeCourse AS EC1 > WHERE NOT EXISTS > ( SELECT CourseID FROM tblCourse > WHERE CourseID In (1,2,4,5) AND NOT EXISTS > ( SELECT * FROM tblEmployeeCourse AS EC2 > WHERE EC2.CourseID = tblCourse.CourseID > AND EC2.EmployeeID = EC1.EmployeeID)) > Ouch! My head hurts! -- Stuart -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com