Need to select two distinct columns in my recordset

I have one table named AttendanceGrid:

Here are an example of the data and column names

Name   Activity   Start          Stop       Month      Notes

Bobby      Tennis    12:00pm   2:00pm   January     None
Timmy     Tennis    12:00pm   2:00pm   February     None
Joyce        Tennis    1:00pm    3:00pm    February     None
Dennis     Tennis    12:00pm   2:00pm   January     None
Sue          Tennis    1:00pm     3:00pm   January     None
Bart         Soccer   12:00pm   2:00pm   January     None

I would like to select Distinct Activity records associated with the Start and Stop Time.  For example if I selected distinct Activity associated with Start and Stop times I should be able to pull up the following:

Tennis   12:00pm  2:00pm
Tennis   1:00pm    3:00pm
Soccer   12:00pm   2:00pm

How can I write an SQL statement to do that?  I am quite novice to SQL code
al4629740Asked:
Who is Participating?
 
nishant joshiTechnology Development ConsultantCommented:
select  Activity,MAX(Start),MAX(Stop) from tbl group by Activity

Open in new window

0
 
wdosanjosCommented:
Perhaps:
select distinct Activity, Start, Stop
  from AttendanceGrid

Open in new window

0
 
al4629740Author Commented:
What does the Max in  MAX(Start) mean?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
nishant joshiTechnology Development ConsultantCommented:
max which is an aggregate function.
0
 
al4629740Author Commented:
what does it do?
0
 
Anthony PerkinsCommented:
Here is what SQL Server's BOL states about MAX():

Returns the maximum value in the expression.
...
For character columns, MAX finds the highest value in the collating sequence.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.