Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>So they could pick 'Customer Name', 'Order Date' and 'Total Amount' from the list of
>available columns. I then write out one record each for 'CustName, OrdDate and TotAmount'.
Order By can use numbers as an alias for the fields. If you don't let the user pick what fields are in the select fieldlist, they remain constant.
>
> select e.id,;
> e.caption,;
> e.internal_id,;
> l.Caption as location,;
> e.cur_meter,;
> e.model,;
> e.serial_no;
> from equipment e;
> left outer join locations l on l.id = e.location_id;
> order by &cSortOrder;
> into cursor temp1
>
>The problem now is the JOIN. When this code is run against only one table, all
>ListSortDetails needs to store is the column name.
>
>In the case of the JOIN, I now need to store the table alias also.
>
>This seems like it could be real cumbersome.
>
>Anyone have a better idea?
Order by 3, 6 would be ordered by internal_id and model. No aliases required.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only