|
 |
access_asp thread: Counting records in ASP
Message #1 by "Andrew Matheson" <amatheso@y...> on Tue, 5 Feb 2002 15:02:02
|
|
Hello all,
I am currently setting up a student tutorial database in a unuversity
college. Every thing is progressing really well, except i am stuck with a
counting issue.
Every tutorial is taken by a teacher, and i need to work out a way to
calculate payment for this. Every time the attendance check is taken, The
students are ticked of in the database, using checkboxes (ie attendance is
True or False). In the Tute_Attend Table, each student has a row with
columns for: Week_1, Week_2, week_3, Week_4, Week 5, and Month and Year.
The following shows a Tute Attendance.
ID_Key |Tute_ID |Week1... etc|Year |Month |TutorID |Student_ID
------------------------------------------------------------------------
1 35 [T] 2002 Feb 94 983248
2 67 [F] 2002 Feb 95 983456
3 35 [T] 2002 Feb 94 987456
4 67 [T] 2002 Feb 95 983478
------------------------------------------------------------------------
How do i produce a query which will tell me how many students went to each
tute in each week.
I have tried in asp, which is a little messy. However if you know of a
way in Access or asp to do this....PLEASE HELP.
Kind Regards,
Andrew
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 6 Feb 2002 12:05:40 +1100
|
|
Not entirely sure how your table structure works, but something like:
SELECT
Week,
Count(Week) AS Count
FROM
TableNameHere
GROUP BY
Week
I don't know whether you want to group by tuteID, then Week, or just by Week
(it's not clear from your question), but these go into the GROUP BY clause.
Your records are grouped, then the number of records in each group is
counted.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Andrew Matheson" <amatheso@y...>
Subject: [access_asp] Counting records in ASP
: Hello all,
:
: I am currently setting up a student tutorial database in a unuversity
: college. Every thing is progressing really well, except i am stuck with a
: counting issue.
:
: Every tutorial is taken by a teacher, and i need to work out a way to
: calculate payment for this. Every time the attendance check is taken, The
: students are ticked of in the database, using checkboxes (ie attendance is
: True or False). In the Tute_Attend Table, each student has a row with
: columns for: Week_1, Week_2, week_3, Week_4, Week 5, and Month and Year.
:
:
: The following shows a Tute Attendance.
:
: ID_Key |Tute_ID |Week1... etc|Year |Month |TutorID |Student_ID
: ------------------------------------------------------------------------
: 1 35 [T] 2002 Feb 94 983248
: 2 67 [F] 2002 Feb 95 983456
: 3 35 [T] 2002 Feb 94 987456
: 4 67 [T] 2002 Feb 95 983478
: ------------------------------------------------------------------------
:
: How do i produce a query which will tell me how many students went to each
: tute in each week.
:
: I have tried in asp, which is a little messy. However if you know of a
: way in Access or asp to do this....PLEASE HELP.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |