Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List Sort Design Question
Message
From
25/06/2006 10:13:46
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01131472
Message ID:
01131515
Views:
17
>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
Map
View

Click here to load this message in the networking platform