Delete the SQL expression and then save your report (now the "main" report), and then do a "save as" to create a copy of it which you can rename with an extension of "-sub", for example.
In the main report, insert another report header section, and then in design mode move your current report header so that it is RH_b. Next go to insert->subreport and select "choose existing report" and select your subreport and insert it in RH_a. Do not link the subreport to the main report.
In the subreport, insert a group on the EVENTS.EMPID field. Then change your {@onsitenow} formula to the following and place it in GF_1:
Whileprintingrecords;
Shared Numbervar onsite;
If remainder(sum({READER.TIMEATT},{EVENTS.EMPID}),3)=1 then
onsite := onsite + 1;
In the main report, create a formula {@OnsitenowTotal} and place it in the appropriate spot in RH_b:
Whileprintingrecords;
Shared numbervar onsite;
To make the subreport and the section it is in disappear, do the following. Note that you cannot directly suppress the subreport OR the RH_b section itself.
Within the subreport, in the section expert, suppress all sections of the subreport and format each section to "suppress blank section". In the main report, go to format->format subreport-> check "suppress blank subreport". Then still in the format editor go to the border tab and change the border lines to "None". In the mai report, format RH_a in the section expert to "suppress blank section".
-LB