I have a group of students who, during the course of a school year, participate in one or more activities for varying lengths of time. The object of the game is, for each student, to report the number of consecutive activities in which he or she participated during the year. For example,
Year Student Activity StartDt EndDt
2009 A band 20080925 20090630
2009 A soccer 20080923 20090205
2009 A theater 20090319 20090501
2009 A chess 20090503 20090612,
student A would have had 3 consecutive activites: soccer, theater and chess. So I would want to see a result set with the values:
Year Student #Activities
2009 A 3
Any suggestions would be greatly appreciated.
Year Student Activity StartDt EndDt
2009 A band 20080925 20090630
2009 A soccer 20080923 20090205
2009 A theater 20090319 20090501
2009 A chess 20090503 20090612,
student A would have had 3 consecutive activites: soccer, theater and chess. So I would want to see a result set with the values:
Year Student #Activities
2009 A 3
Any suggestions would be greatly appreciated.