>This has to be done in FoxPro 2.5 so views are not an option.
>
>I have 2 separate tables both with a date field and a memo field. Both date fields are called Readdate. The memo field in table1 is called Comments and table2's is called Cparam.
>
>What I need to end up with is a Cursor, combining both tables data, with Readdate, Comments, Cparam ordered by Readdate. How do I code the SQL-SELECT for this or is there a better way? My best idea so far is 2 SELECT's UNION'd together.
SELECT ReadDate, Myfield1 AS Field1, MyField2 AS Field2, Comments ;
FROM MyTable1 ;
UNION ;
SELECT ReadDate, MyOtherField1 AS Field1, MyOtherField2 AS Field2, Cparam AS Comments ;
FROM MyTable2 ;
ORDER BY 1 ;
INTO CURSOR ac_Cursor
The 'AS' commmands are redundant, I just put them in for clarification.
The Format for Myfield1 MUST match MyOtherField1 and likewise for 2.
HTH
Matt McDonnell
...building a better mousetrap with moldy cheese...