Yes, I would change the second formula to this:
//Record Greatest Consecutive
WhilePrintingRecords;
global NumberVar TotalConsecutive;
global NumberVar RecentConsecutive;
global NumberVar GreatestConsecutive;
//If absent, increase Consecutive count
if {SR_STUD_ATTEND.ATND_ID} = "A" then
TotalConsecutive:= TotalConsecutive + 1
//If not absent reset
else if TotalConsecutive > 0 or OnLastRecord or
{SR_STUD_ATTEND.<studentIDfield>} <> next({SR_STUD_ATTEND.<studentIDfield>}) then (
// If current consecutive count is greater than the last one
if TotalConsecutive > GreatestConsecutive then
GreatestConsecutive:= TotalConsecutive;
//Assign last count to Recent
if TotalConsecutive > 0 then
RecentConsecutive:= TotalConsecutive;
//Reset Total Consecutive
TotalConsecutive:= 0; )
If you don't have the parentheses, Crystal will always evaluate the statements instead of only evaluating them if it's not an absence. I would also force the evaluation on the last record for the student or the last record in the report. Otherwise you migh miss a set of consecutive absences if they are the last records for the student.
-Dell