>Hi all,
>the code below works but I need to add in an order by field1, field2 but I can't get it to work, I get an order by error. I've tried a simple order by command but no joy, also tried moving between engine behaviour 70/80/90 with no luck. Any help appreciated.
>~M
>
>
>sele FIELD_LIST ;
> from TBALE1 ;
> join TABLE2 ;
> join TABLE3 ;
> where something ;
> AND something else ;
> UNION ;
>sele FIELD_LIST
> from TBALE1 ;
> join TABLE2 ;
> join TABLE3 ;
> where something ;
> AND something else ;
> into cursor temp2 nofilter
>
Adding ORDER BY before into cursor should work. What is the exact error you're getting?
In the worse case scenario you can
select * from (...
UNION
...) X
ORDER BY ...
If it's not broken, fix it until it is.
My Blog