View Single Post
  #2  
Old May 14th, 2010, 09:22 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default SELECT DISTINCT query

Are you saying that you only want one record for the tblFamily.FamID? If so
is that field the primary key field in tblFamily? Also what do you want to
see for the reset of the record? For example which individual do you want to
see?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"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.
.