and in addition to what Sergey says, if this function can be used in other parts of your system, store it in its own .PRG, and replace the function line with an LPARAMETERS statement.
>The first line is part of a SQL statement, the second is the first line of the function in the same prg. Both are inside the same DEFINE CLASS and ENDDEFINE lines. I get an error on the SQL that the PlanCount program is not found. Not sure why it cannot be found.
>
>
>PlanCount(IDNum, PlanID, EligEmps) AS EligEmps, ;
>
>FUNCTION PlanCount(tIDNum, tPlanID, tAmount)
>