Creating the following output by running a query in MS Access table

sgrahman

New member
Local time
Yesterday, 18:41
Joined
Apr 14, 2003
Messages
3
Hi,
I have sample table with student_id,tch_id and all other fields. For each student we can have one, two, three or maximum of four teacher teaching.
If I have one teacher teaching one student then under "tch_id1", I would like to add that techer id and under "tch_pct1" column I will give .50 credit to that teacher. If one student is tied to two teachers, I will add two teacher ids under the columns "tch_id1" and "tch_id2" then give .25 credits .25 to each teacher under "tch_pct1" and "tch_pct2". For three teacher credits will given (.166) to each and for four teacher credits will be given (.125) to each teacher.
Credits are calculated .50 divide by # of teachers. Please look at the input and output tables. Here are the table:


student_id tch_id tch_id1 tch_pct1 tch_id2 tch_pct2 tch_id3 tch_pct3 tch_id4
tch_pct4
190078 3417350
181994 3508127
181994 3204965
587617 3206543
587617 3504125
587617 3138556
405203 3285887
405203 3267702
405203 3145775
405203 3508030



After running the query the output will look like this:
student_id tch_id1 tch_pct1 tch_id2 tch_pct2 tch_id3 tch_pct3 tch_id4 tch_pct4
190078 3417350 0.5
181994 3508127 0.25 3204965 0.25
587617 3206543 0.166 3504125 0.166 3138556 0.166
405203 3285887 0.125 3267702 0.125 3145775 0.125 3508030 0.125


Hope I was able to explain it. I would really appreciate anyone's help. Thanks.
 

Users who are viewing this thread

Back
Top Bottom