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!

Comparing lists 1

Status
Not open for further replies.

OpsO

IS-IT--Management
Mar 1, 2012
3
US
I have two querys that produce lists of employee numbers. One list is employees that have been trained and the other is just a list of all employees. I am trying to create a third query to return a list of employees that have not been trained. Any suggestions?

I didn't create a query simply asking which employees did not have the code for this specific training because each employee has multiple codes in the training table and I haven't figured out how to extract specific codes that are missing.
 
I am using Congnos Report Studio
 
Create a set from both queries. From query panel drag the except set operator to the right. In the query panel you will then see two placeholders for queries. Drag the existing queries (that will have to be identical in number of dataitems and datatypes) into these placeholders. These will then be presented as query references.
There will now be a third query that is the result of the except set operator like:

Select ....
from
(select .... from ....
except
(select .... from ....

The order of the queries is crucial the second set will be subtracted from the first set. So, if the first query contains all employees and the second query those who are trained than the except set operator will yield a list of employess NOT trained.

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top