View Single Post
  #9  
Old May 17th, 2010, 06:02 PM posted to microsoft.public.access.queries
Kathy R.
external usenet poster
 
Posts: 20
Default SELECT DISTINCT query

Jerry,
This worked great. Thank you! Could you indulge me just a bit further
and explain why it works? As I see it, the "SELECT DISTINCT" is
choosing distinct records that have all five fields the same
(FamLastName and address info). So, if I had Jones and Smith residing
at the same address, they would both show up. Is this correct?

I always thought I needed the field that is in the "WHERE" clause, in
the "SELECT" clause also. Apparently not!

Thanks again!

Kathy R.

Jerry Whittle wrote:
SELECT DISTINCT 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*"));