DISTINCT predicate and multiple fields

dbasch

Registered User.
Local time
Today, 18:10
Joined
Jan 27, 2003
Messages
13
Hello,
I am trying to do a query such as:

SELECT DISTINCT [Qualified Leads].[Company], [Qualified Leads].[Record Creator]
FROM [Qualified Leads];

This returns all of the records that have fields taht are a combination of unique values. However, what I really need is just the company field to be distinct. I can acheive this by selecting just the company field. But, what do I do if I want to select distinct companes and also include other fields in the select statement that are not distinct?

Something like this if you pretend the *'s limit the scope of the distinct predicate:

SELECT *DISTINCT [Qualified Leads].[Company]*, [Qualified Leads].[Record Creator]
FROM [Qualified Leads];

Is this possible?

Thanks Everyone,
Derek Basch :D
 
If there are multiple qualified leads for a company, the company will appear multiple times in the recordset. That is the way queries work. Use a report if you want to supress duplicates.
 

Users who are viewing this thread

Back
Top Bottom