Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table named "bat.student_attendance" which contains 30 columns for each day of month.
I used to update that day column on current date but also want to update total present days and total absent days on each day, for that I have to count all columns but i didnt get it done..plz do suggest .
CSS
1   12  52  5   2014-01-04 00:00:00.000 p   p   p   p   p   a   a   p   p   l   p   p   p   p   p   p   a   p   p   NULL    p   p   p   p   p   p   NULL    a   p   p   NULL    NULL    NULL
2   12  52  3   2014-01-04 00:00:00.000 p   p   p   p   NULL    a   p   p   p   p   NULL    a   a   p   p   p   a   p   l   NULL    NULL    a   p   p   l   p   p   p   a   p   p   NULL    NULL
3   12  52  6   2014-01-04 00:00:00.000 p   p   p   a   p   p   l   p   p   p   p   p   p   p   p   p   p   p   p   NULL    p   a   p   a   p   a   p   a   p   a   NULL    NULL    NULL
4   12  52  9   2014-01-04 00:00:00.000 p   p   p   p   p   p   p   p   p   a   l   a   a   NULL    a   a   p   p   p   NULL    a   p   p   p   a   p   p   p   p   p   p   NULL    NULL


Here is my table with value.
Posted

1 solution

Table structure like
VB
StudentID   [Date]      IsPresent
1           20-04-2014  true
2           20-04-2014  false
3           21-04-2014  true
4           21-04-2014  true
5           22-04-2014  false



rest of things lie count & all you query itself.
 
Share this answer
 
Comments
rahulDer 24-Apr-14 2:08am    
its workable, but it takes 30 rows for each student and it cause memory issues for 1000+ students

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900