Avoiding multiple records

  • Thread starter Thread starter John Barnes
  • Start date Start date
J

John Barnes

Have a query designed to select according to date range
and excluding several programs a client might be involved
in. Each client will have multiple meeting dates entered,
and I only want the earliest one to show in query output.
How do I pick only the first History ID for each client or
the first date?

Code follows:

SELECT DISTINCT [Meeting history].HistoryID,
tblSchoolBased.StartDate, [Meeting history].Activity,
tblSchoolBased.Ethnicity, tblSchoolBased.Location,
tblSchoolBased.Age, tblSchoolBased.Income,
tblSchoolBased.Gender, tblSchoolBased.[Student First
Name], tblSchoolBased.[Student Last Name], [Meeting
history].[Meeting date]
FROM tblSchoolBased INNER JOIN [Meeting history] ON
tblSchoolBased.[Record ID] = [Meeting history].[Record ID]
WHERE (((tblSchoolBased.StartDate)>=[Forms]!
[frmDateSelection]![beginningdate] And
(tblSchoolBased.StartDate)<=[Forms]![frmDateSelection]!
[endingdate]) AND (([Meeting history].Activity)<>"PP
Voluntary" And ([Meeting history].Activity)<>"PP
Mandated"));


Thanks for your help!


John
 
Back
Top