View Single Post
  #3  
Old May 14th, 2010, 09:24 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default SELECT DISTINCT query

You can get that with this --
SELECT tblFamily.FamID
FROM tblFamily
GROUP BY SELECT tblFamily.FamID;

But what other field do you want with it?


--
Build a little, test a little.


"Kathy R." wrote:

Hi folks,

Using Access 2007. I have a query (SQL below) in which I need to select
only those records with distinct FamID's I'm pretty sure I need to use
SELECT DISTINCT, but if I put that right at the beginning it's looking
for a whole distinct record, not just the distinct FamID (if I
understand it correctly). How can I change this query so that I end up
with records where the FamID field is distinct?

SELECT tblFamily.FamID, tblGroup.GroupName, tblFamily.FamLastName,
tblAddress.Street, tblAddress.City, tblAddress.State, tblAddress.ZipCode
FROM tblGroup INNER JOIN (((tblFamily INNER JOIN tblIndividual ON
tblFamily.FamID = tblIndividual.InFamID) INNER JOIN tblAddress ON
tblFamily.FamID = tblAddress.AdFamID) INNER JOIN tblGroupMembers ON
tblIndividual.IndID = tblGroupMembers.GMIndID) ON tblGroup.GroupID =
tblGroupMembers.GMGroupID
WHERE (((tblGroup.GroupName) Like "*flm*"));

Thank you for your help!

Kathy R.
.