Well, I thought I could generalize my problem to a simple example. But this example does work as is. But I'm 100% sure that my more complex query doesn't work. In the table desinger the order is as written in the query, but visually it isn't. Copying to excel for example the order is the same as written. Maybe a bug. Deleting the output table and re-running seems to work...
>Are you sure? What following code returns
>
>USE IN (SELECT("outputklm"))
>Select aveld, cveld, bveld from klm into table outputklm
>FOR i=1 TO 3
> ? FIELD(i)
>ENDIF
>
>>I'm writing a query witn an output to a table that already exists. Strange thing is that the order of the fields is not equal to the order as it is written in the query. It place the fields in alphabetic order in stead of how it is written.
>>
>>For example:
>>
>>Select aveld, cveld, bveld from klm into table outputklm
>>
>>
>>I get the following order in the output table aveld, bveld, cveld. How could I solve this?