The Record Selection formula should look like this:
numbervar i;
stringvar array arr := {?Parameter_Name};
numbervar array sunits;
for i := 1 to ubound(arr) do
(
redim preserve sunits[i];
If arr[i] = '0-ALL' then
sunits[i] := 99;
else
sunits[i] := Left(arr[i],6);
);
{command.Patient Age} >= 18
AND ({command.DepartmentID} IN sunits or 99 in SelectedUnits)
-Abhilash