I've decided that the only solution is to re-enter the whole query as a sub report, selecting on 'B' and 'V' only.
This seems to me to be a long-winded method of getting to an apparently simple task. Does anyone have a simpler solution. Here's the orginal sql on which the xtab is based.
SELECT
RELFB."STATUS1", RELFB."STATUS2",
RELEA."SATZART", RELEA."FIRMENNR", RELEA."ARTIKELNR", RELEA."BEZEICHNUNG", RELEA."EDATUM", RELEA."EJAHR", RELEA."EMONAT", RELEA."ETAG", RELEA."ANR", RELEA."MENGE", RELEA."ME", RELEA."UMSATZ", RELEA."AGKNZ1", RELEA."STATUS2",
RELFIRMA."KTXT", RELFIRMA."FGKNZ_1"
FROM
"INFOR"."RELFB" RELFB,
"INFOR"."RELEA" RELEA,
"INFOR"."RELADRESSE" RELADRESSE,
"INFOR"."RELFIRMA" RELFIRMA
WHERE
RELFB."RNR" = RELEA."RNR" AND
RELFB."ADRNR2" = RELADRESSE."ADRESSENR" AND
RELADRESSE."FIRMANR" = RELFIRMA."FIRMANR" AND
RELEA."SATZART" = 'ABA'
RELFB."STATUS1" = 'L'
ORDER BY
RELEA."STATUS2" ASC
The new criteria would select "STATUS2" as one of either 'B' or 'V', and create a grand total. Is there a solution without using the sub-report option?