T
TUNSTAD
Please can anyone help?
Right then, I have a table with students records that tracks name, address,
teacher, etc....
I want to be able to create a query that lists 20% of each Teachers current
students for a questionnaire.
I am using the following Module to generate random students:
Function Randomizer() As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize: AlreadyDone = True
Randomizer = 0
End Function
I am using the following to generate 20% of students:
SELECT TOP 20 PERCENT [Application Form].*, [Application Form].[Trainee
Status], [Application Form].Trainer
FROM [Application Form]
WHERE ((([Application Form].[Trainee Status])=2) AND (([Application
Form].Trainer)=2) AND ((randomizer())=0))
ORDER BY Rnd(IsNull([Application Form.Surname])*0+1);
Getting 20% of all current students is fine, but I want 20% of each Teachers
Current Students??????
For example, If Teacher 1 has 30 students I want to list 6 students
If Teacher 2 has 40 students I want to list 8 students
Hope you can help.
Thanks
Right then, I have a table with students records that tracks name, address,
teacher, etc....
I want to be able to create a query that lists 20% of each Teachers current
students for a questionnaire.
I am using the following Module to generate random students:
Function Randomizer() As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize: AlreadyDone = True
Randomizer = 0
End Function
I am using the following to generate 20% of students:
SELECT TOP 20 PERCENT [Application Form].*, [Application Form].[Trainee
Status], [Application Form].Trainer
FROM [Application Form]
WHERE ((([Application Form].[Trainee Status])=2) AND (([Application
Form].Trainer)=2) AND ((randomizer())=0))
ORDER BY Rnd(IsNull([Application Form.Surname])*0+1);
Getting 20% of all current students is fine, but I want 20% of each Teachers
Current Students??????
For example, If Teacher 1 has 30 students I want to list 6 students
If Teacher 2 has 40 students I want to list 8 students
Hope you can help.
Thanks