>>It's invalid query because "MyTable.MyField" isn't either aggregate function nor it's included in the GROUP BY.
>>
>
>I changed the SQL Select, making Group By "1,2" (instead of just 2) and it works now.
>
Than you can change
having not empty(&lcExpr)
WHERE not empty(&lcExpr)
--sb--