lcCode="ABC" SELECT cDate1 AS cDate FROM mytable WHERE cCode=lcCode ; UNION ALL ; SELECT cDate2 AS cDate FROM mytable WHERE cCode=lcCode ; UNION ALL ; SELECT cDate3 AS cDate FROM mytable WHERE cCode=lcCode ; UNION ALL ; SELECT cDate4 AS cDate FROM mytable WHERE cCode=lcCode ; UNION ALL ; SELECT cDate5 AS cDate FROM mytable WHERE cCode=lcCode ; UNION ALL ; SELECT cDate6 AS cDate FROM mytable WHERE cCode=lcCode ; HAVING EMPTY(cDate)=.F. ; INTO CURSOR resultThe HAVING eliminates any blank data in the cDate fields.
SELECT ; cDate1,cDate2,cDate3,cDate4,cDate5,cDate6 ; FROM ; mytable ; WHERE ; cCode="ABC" ; INTO ; ARRAY myarray * * At this point the array is dimensioned as [1,6] * We'll change rows to columns and vice-versa... i.e., a [6,1] * DIMENSION myarray[6,1] CREATE CURSOR mycursor (cDate c(10)) APPEND FROM ARRAY myarrayYou can add code to eliminate blanks if there are any.