Re: Designing query to only show unique records



kdubble wrote:
That didn't work:

here's my SQL view

SELECT DISTINCT Student_Info.Student_Record, Student_Info.Grade,
Student_Info.SchoolName, Session_Information.Counselor,
Session_Information.Date, Student_Info.[Student Last]
FROM Student_Info INNER JOIN (Session_Information INNER JOIN
Services_To_Students ON Session_Information.[Session#] =
Services_To_Students.[Session#]) ON Student_Info.Student_Record =
Services_To_Students.Student_Record
GROUP BY Student_Info.Student_Record, Student_Info.Grade,
Student_Info.SchoolName, Session_Information.Counselor,
Session_Information.Date, Student_Info.[Student Last]
HAVING (((Session_Information.Counselor)<>"All Counselors" And
(Session_Information.Counselor)<>"Paid Tutor/counselor") AND
((Session_Information.Date) Between #7/1/2006# And #6/27/2007#));

my results show each individual service that a given student_record
receives. I just want to show how many students got serviced in a
date range.

DISTINCT will work if you don't include any fields from the
Session_Information table in your output.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


.



Relevant Pages

  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL Query ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQl Data Provider Performance Issues
    ... Can you provide a complete sample app ... selects with a single inner join perforn OK. ... When I run the query from SQL ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: sysindexes
    ... collation, but you should be able to use it for your column change as well. ... SQL Server MVP ... DECLARE @sql VARCHAR ... INNER JOIN information_schema.table_constraints tc ...
    (microsoft.public.sqlserver.server)
  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL Query ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)