>I am doing exactly that...outputting the data to Excel. I need the fields to output in Excel in a certain order because we have macros that run on the spreasheets and look for the data in a certain column. This is proving to be difficult for me as the number / name of fields in the table I am working with always varies, so I don't know how to specify the order I want when I don't really know what is going to be in the table.
You could store the fields list to a variable, lcFields.
Then use SELECT &lcFields FROM ... and so on.
Using the macro expansion lets you create the list of fields to select in your program so that it's not hard coded.
I have found one problem (in VFP7). IF there are no function calls in the select, or it only selects from one table, then the order of the fields in the result is NOT the order you put in the fields list!
My workaround was to use UPPER() around our Primary Key fields, because they are always character and always uppercase anyway. I don't change the data, but it does force VFP to do what I tell it, and not what it feels like :)