Zlatin,
It'd work if you take time to 'as' ordering fields with a 'different' name. But I simply can't understand why I need the union here. If you don't have it then you don't need the 'as' for existing fields too, right? If he'd edit this and use in update, with renaming fields would need more conversion :(
Cetin
>I must admit that I have missed something:
>The correct command will be
>
>SELECT NOCLIENT AS O_NOCLIENT ,NOCAT AS O_NOCAT,NUMERO,NOMEMBER,NOPARENT AS O_NOPARENT,NOTHREAD AS O_NOTHREAD,ADDDATE,ADDHEURE,TITLE,.T. AS FLAG,1 AS ORDERF ;
> FROM THREAD WHERE NoClient=5 AND NUMERO>=600000;
>UNION SELECT NOCLIENT AS O_NOCLIENT ,NOCAT AS O_NOCAT,NUMERO,NOMEMBER,NOPARENT AS O_NOPARENT,NOTHREAD AS O_NOTHREAD,ADDDATE,ADDHEURE,TITLE,.T. AS FLAG,0 AS ORDERF;
> FROM THREAD WHERE NoClient<>5 AND NUMERO>=600000;
> ORDER BY ORDERF DESCENDING,O_NOCLIENT,O_NOCAT,O_NOTHREAD,O_NOPARENT INTO CURSOR TEMP READWRITE
>
>
>So If you wish to use order by with names you should have additional AS clauses with names different from your field names.
>
>I have tested it with only one order by clause and this was why I did not post you the correct query the first time