September 21, 200421 yr Newbies I have two related databases. One (X) has a record for every lesson every teacher teaches in one week (several thousand records). The other (Y) to calculate the total number of specific lessons performed by each teacher (there are 70 teacher records) I am trying to use a summary field in (X) that counts the number of specific lessons (after performing a find for one teacher). I need the (Y) to perform a script in which it opens (X) performs a find on teacher A then transfers the summary field value across to A in (Y) and then returns to (X), performs a second find for teacher B, etc. etc. How do I write a script in (Y) that can continually change the Perform Find request (for (X)) for each of the 70 teachers rather than me typing in each teacher for every find?
September 21, 200421 yr Hi, All this seems rather complex procedure, compared to what relationships would do in this case. "I need the (Y) to perform a script in which it opens (X) performs a find on teacher A then transfers the summary field value across to A in (Y) and then returns to (X), performs a second find for teacher B, etc. etc. " Count(RelationshipToA:LessonID) would be a calc, which you may transfer to a number field at wish. It's just a matter of how you define your 'RelationshipToA', but from I understood, the goal is to grab the total of related records for a specific lesson for each teacher. So the key on the right side (your related file) would be : cCompound = LessonID& " "& TeacherID The Key on the Left side would be : cgCompound = gLessonID& " "& TeacherID, gLessonID being a global field, where you'd input the exact lesson you're looking for. Of course, you could include a Year, or any other parameter to this compound if you needed to reduce the foundset. HTH
September 21, 200421 yr Author Newbies Thnakyou but I'm still not sure whether that will work as the different lesson fields may contain "11CH", "11PH", "10SC", "8EN" "9CO", etc. (I import these from our ancient school timetable program) What I'm trying to count is the number of 11 and 10 classes taught by each teacher no matter what type ie. PH, CH, etc. I originally planned to use a summary field that also used the Left function to cut it back to the first two letters ie. "11" Anyway I'll give it a go and see what happens.
September 28, 200421 yr Sorry, I skipped this post. In this case, a Sum ( ) should work with this code converted to TextToNum(MyCode). Actually, I'm not sure if a standard Sum( ) wouldn't work as well. Ugo
Create an account or sign in to comment