m.ix = 0 SCAN m.ix = m.ix + 1 lcFields = lcFields + IIF(m.ix > 1, ', ','') + ALLTRIM(FieldName) + ' AS Fld'+TRANSFORM(ix) ENDSCAN for m.ix = m.ix to 8 lcFields = lcFields + IIF(m.ix > 1, ', ','') + ' [ ]AS Fld'+TRANSFORM(ix) next i lnReportColumnCount = m.ix RunSQL = 'SELECT ' + lcFields + ' FROM ' + lcTable + ' ORDER BY ' + lcOrderField + ' INTO CURSOR ReportCursor' &RunSQL* Update, of course you needed to remove the field name from the expression in the FOR