group by encounter number, i guess order by next review date
create a formula that resets every new encounter,
and stores in a shared datetimevar the value of the 'next review date'
if the date is available, compare the completed against the shared variable and determine teh value...something like:
in group header
shared datetimevar nextDate := "1/1/1900"
""//hides the reset
in the detail section:
shared datetimevar nextDate;
local numbervar daysElapsed;
if nextDate <> "1/1/1900" then
daysElapsed := datediff("d",{table.field}, nextDate);
if daysElapsed > 7 then
"very late"
else
if daysElapsed >3 and daysElapsed < 8 then
" late"
else
"on time"
I might have the datediff function backwards, you might need to reverse the {table.field} and nextDate if the values are negative.
HTH