CTQE Registered User. Local time Yesterday, 19:42 Joined Feb 27, 2008 Messages 48 Aug 5, 2008 #1 Hello All, I have a table with two fields, one named Class_Name & the other Employee. How do I create a query that defines which employee has not taken a specific class?
Hello All, I have a table with two fields, one named Class_Name & the other Employee. How do I create a query that defines which employee has not taken a specific class?
N namliam The Mailman - AWF VIP Local time Today, 04:42 Joined Aug 11, 2003 Messages 11,685 Aug 5, 2008 #2 I presume you have ID or some primary key someplace? Something like below will give you all employees that have not taken a class. Select * from yourTable where YourPrimaryKey not in (select YourPrimaryKey from yourTable where Classname = '')
I presume you have ID or some primary key someplace? Something like below will give you all employees that have not taken a class. Select * from yourTable where YourPrimaryKey not in (select YourPrimaryKey from yourTable where Classname = '')
CTQE Registered User. Local time Yesterday, 19:42 Joined Feb 27, 2008 Messages 48 Aug 5, 2008 #3 thanks for the quick reply I do have another table where all the employee are identified. The primary key is the Empoyee's name. I understand your theory but I do not know the syntax required to convey that command. Could you assist me with that?
thanks for the quick reply I do have another table where all the employee are identified. The primary key is the Empoyee's name. I understand your theory but I do not know the syntax required to convey that command. Could you assist me with that?
N namliam The Mailman - AWF VIP Local time Today, 04:42 Joined Aug 11, 2003 Messages 11,685 Aug 5, 2008 #4 CTQE said: The primary key is the Empoyee's name. Click to expand... NOOOOOOOOOOOOOOOOOOOOOOOOOOOO, no no no no... Someones name CAN NEVER be a Primary key ! NO NO NO! I strongly advice you to change this and use at the very least an autonumber as the primary key, not the name !!! CTQE said: I understand your theory but I do not know the syntax required to convey that command. Click to expand... Syntax was allready given?!
CTQE said: The primary key is the Empoyee's name. Click to expand... NOOOOOOOOOOOOOOOOOOOOOOOOOOOO, no no no no... Someones name CAN NEVER be a Primary key ! NO NO NO! I strongly advice you to change this and use at the very least an autonumber as the primary key, not the name !!! CTQE said: I understand your theory but I do not know the syntax required to convey that command. Click to expand... Syntax was allready given?!