I would try using another formula with a variable. Assuming that you're looking at the status of "orders", it might look like this:
{@ResetFulfilled}
BooleanVar fulfilled := false;
Put this in the Order group header section.
You would then change your formula slightly to this:
shared numbervar diff;
shared datevar start;
shared datevar end;
shared BooleanVar fulfilled;
if {NAME} = 'In Progress' then
start := date({DATE_TIME})
else if {NAME} = ['On Hold', 'Fulfilled'] then
(
if {NAME} = 'Fulfilled' then fulfilled := true;
if not fulfilled then
end := date({DATE_TIME});
if start <> cdate(0,0,0) then
(
diff := diff + DateDiff('d',start,end);
);
;
end;
)
-Dell