473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Distinct Query Help?

Hi, I am a intermediate user who has a database of employees and their training history/courses attended. Can someone please help - I need to find out all the employees who HAVEN'T done a particular course. When I try to create a query and type in the course code as 'not' etc is shows me every course everyone has done (except the selected one). I only want a list of employees who haven't done that course. With their name appearing once. Distinct doesn't work on this either. What am I doing? Any help would be appreciated, however, I don't have much to do with SQL - am a basic query writer only. Please keep as simply as possible. THANK YOU!!!!! Kez
Aug 24 '06 #1
2 2327
MMcCarthy
14,534 Expert Mod 8TB
In your query double click on the Join/Relationship line between the two tables and change the join to be all records in employyes table and only those records in the courses taken table that are equal.

If you put this criteria
Is Null
under the unique ID column of the courses taken table the query should only return employees without a corresponding record in the courses taken table.

You may need further criteria to only return a particular course.

Hi, I am a intermediate user who has a database of employees and their training history/courses attended. Can someone please help - I need to find out all the employees who HAVEN'T done a particular course. When I try to create a query and type in the course code as 'not' etc is shows me every course everyone has done (except the selected one). I only want a list of employees who haven't done that course. With their name appearing once. Distinct doesn't work on this either. What am I doing? Any help would be appreciated, however, I don't have much to do with SQL - am a basic query writer only. Please keep as simply as possible. THANK YOU!!!!! Kez
Aug 24 '06 #2
In your query double click on the Join/Relationship line between the two tables and change the join to be all records in employyes table and only those records in the courses taken table that are equal.

If you put this criteria
Is Null
under the unique ID column of the courses taken table the query should only return employees without a corresponding record in the courses taken table.

You may need further criteria to only return a particular course.
Hi again, thanks for the reply. I need the query, however, to return all the names of employees who haven't done a particular course. When I enter the course number I get employees and every course they have done (except the course I enter). I only want their names appearing once. Can you help? Thanks so much...
Sep 25 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Kelvin | last post by:
Okay so this is baking my noodle. I want to select all the attritbutes/fields from a table but then to excluded any row in which a single attributes data has been duplicated. I.E. Here's my...
17
by: keith | last post by:
I am trying to get a exact count of different distinct entries in an Access column. At first, I was trying to work with three columns, but I've narrowed it down to one to simplify it. I've searched...
18
by: mathilda | last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than SELECT all other factors being equal. I disagree. We are linking an Access front end to a SQL Server back end and normally are...
5
by: Fred Zuckerman | last post by:
Can someone explain the difference between these 2 queries? "Select Distinct id, account, lastname, firstname from table1" and "Select DistinctRow id, account, lastname, firstname from table1" ...
4
by: monomaniac21 | last post by:
hi! is it possible to do the aforementioned query - selecting only distinct in 1 col but retrieving all other cols at the same time. regards marc
5
by: JimmyKoolPantz | last post by:
for some reason I can't seem to figure this out. Situation: I'm using vb.net to create a query that will populate a dataset with zipcode and count that have unique first 3 digits. I want to...
1
newnewbie
by: newnewbie | last post by:
Desperately need help in creating a query to count unique values in a table. I am a Business analyst with limited knowledge of Access….My boss got me ODBC connection to the underlying tables for our...
1
by: RussCRM | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
5
zachster17
by: zachster17 | last post by:
Hi everyone, First of all, sorry for the massive amount of SQL I am about to type. I have a database that has a "lives" table of insured employees and then another table (that links to the lives...
1
by: ggfota | last post by:
Hi I have a problem with SELECT DISTINCT query. I'm trying to solve why it causes error 3464. Guess that problem might be cause by one field. The source table has text(17) field from which I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.