Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bpaz2001
Starting Member
3 Posts |
Posted - 2007-04-23 : 13:09:48
|
| Hi, I need some help. I have this query where i need to pull up students that have more than or equal to 3 absences in a row. Now I am getting all those students that are absent but not in a row. But i was wondering if there is a way to tell if a student was absent three days in a row . There is a date field that is being used to identify the day of the class and a status field that identifies if the student was absent or present. Please help someone.Birju |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-04-23 : 13:23:39
|
| please post table structure, some sample data and expected result.************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
bpaz2001
Starting Member
3 Posts |
Posted - 2007-04-23 : 14:38:11
|
| SELECT distinct sa.studentuid, sa.studentname, textterm, sa.srofferid, sadate, status, offername, inserttime,insertuseridFROM cams_studentattendance_view sa INNER JOIN cams_studentregister_view sr ONsr.studentuid = sa.studentuidwhere status = 'absent'Im using this structure to retrieve all the students that are absent for a specific term but i want to find out how can i get the absences that are 3 days in a row or more? |
 |
|
|
bpaz2001
Starting Member
3 Posts |
Posted - 2007-04-23 : 14:40:48
|
| Some sample data is like71856 Boccchein, Svetlana 06/07OLMN 13417 2007-04-09 00:00:00.000 Absent Management Information Systems 2007-04-15 16:07:12.970 hadleys71856 Bocchein, Svetlana 06/07OLMN 13417 2007-04-10 00:00:00.000 Absent Management Information Systems 2007-04-15 16:07:52.430 hadleys71856 Boccchein, Svetlana 06/07OLMN 13417 2007-04-11 00:00:00.000 Absent Management Information Systems 2007-04-15 16:08:39.710 hadleysand expected results is to just the same way but only those students that are absent 3 days or more in a rown |
 |
|
|
|
|
|
|
|