Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List Sort Design Question
Message
De
25/06/2006 10:13:46
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01131472
Message ID:
01131515
Vues:
18
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform