Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Consecutive rows query

Status
Not open for further replies.

brat15

IS-IT--Management
Dec 17, 2004
3
US
Hey,
I trying to write a query which results in all students who have been absent for 2 consecutive classes and 3 consecutive classes. Is there any examples of this kind.

Thanks
 
It might help if you gave us a bit more to go on - table structures, example data, results required etc...

--James
 
The major tables i think we need are

TS_Appointment - The appointment details are here
Appointment_Id
StudentTerm_Id_FK
TutorTimeSlot_Id_FK
AppointmentStatus_Id_FK
TS_TutorTimeSlot - The Appointments available for each tutor
TutorTimeSlot_Id
TutorTimeSlot_day
TutorTerm_Id_FK

TS_StudentTerm
StudentTerm_Id
StudentId_Fk

I need to have all students that have missed a session with a tutor two times in a row and 3 times in a row,
for the same student with the same tutor.

The result should be like

StudentName, Tutor, Day, Date


Any help will be appreciated







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top