AnsweredAssumed Answered

weird problem with script

Question asked by andretru2 on Jan 19, 2012
Latest reply on Jan 19, 2012 by RayCologon

I need to calculate the number of student absences for a specific range of dates.

I have two tables. Students and Attendance, joined by student number. Here is the script.

 

  • Go to Layout [ “Students” (Students) ]
  • Go to Record/Request/Page [ First ]
  • Loop
  • Set Variable [ $Num; Value:Students::STUDENT_NUMBER ]
  • Go to Layout [ “Hcts” (Hcts) ]
  • Set Error Capture [ On ]
  • Enter Find Mode [ ]
  • Set Field [ Hcts::STUDENT_NUMBER; $Num ]
  • Set Field [ Hcts::ATT_DATE; "8/16/2009...7/1/2010" ]
  • Perform Find [ ]
  • If [ Get(FoundCount)=0 ]
  • Set Field [ Students::Count 9_10; "" ]
  • Go to Layout [ “Students” (Students) ]
  • Go to Record/Request/Page [ Next; Exit after last ]
  • Else
  • Set Field [ Students::Count 9_10; Get(FoundCount) ]
  • Go to Layout [ “Students” (Students) ]
  • Go to Record/Request/Page [ Next; Exit after last ]
  • End If
  • End Loop

 

It looks that the script calculates accurately for some students but not for others. I.e. a student has 11 absences, but the found count stores 280. However, if I run the script for this specific student only, it calculates the correct number. What could be the issue and how can I fix it?

 

Thanks,

Outcomes