>>Union needs order by the field # (order by 5,6), not field name.
>
>Thanks! Why is that?
>
>Tommy
This is what one can find in FoxPro Help in VFP7, and in FoxPro 2.5 as well:
*----------------------------
[UNION [ALL] SELECTCommand]
Combines the final results of one SELECT with the final results of another SELECT. By default, UNION checks the combined results and eliminates duplicate rows. Use parentheses to combine multiple UNION clauses.
ALL prevents UNION from eliminating duplicate rows from the combined results.
UNION clauses follow these rules:
You cannot use UNION to combine subqueries.
Both SELECT commands must have the same number of columns in their query output.
Each column in the query results of one SELECT must have the same data type and width as the corresponding column in the other SELECT.
If an ORDER BY clause is included, it affects the entire result.
*-----------------------------