Sub selects work like
FROM
Program.Program AS PROGRAM
INNER JOIN PROGRAM/Program.Program_Supplier/Organization.Supplier AS SUPPLIER
WHERE
SUPPLIER/ID = $SUPPLIERID
GROUP BY
PROGRAM/Name
SELECT
PROGRAM/Name AS ProgramName,
(SELECT COUNT(*) AS C FROM Program.Action AS ACT WHERE
(ACT/ActionStatus='SomeStatus' AND
ACT/Program.Action_Program = PROGRAM/ID AND
ACT/Program.Action_Program/Program.Program/Program.Program_Supplier/Organization.Supplier = $SUPPLIERID) AS ACTIONCOUNT