junk = UDF() && Returns as string such as 'Field1,SUM(Field2) AS Field2' SELECT Field3,&junk,Field4 FROM xxx GROUP BY 1 INTO CURSOR yyyIs something like this what is meant by a subquery in the SELECT clause of the SQL SELECT statement? See Visual FoxPro 9.0 Language Reference SELECT - SQL Command - SELECT Clause in VFP9 help: "(Subquery) Subquery specifies a SQL SELECT statement within another SQL SELECT statement and must be enclosed within parentheses (()). "