Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Turning the tables
Message
De
24/01/2017 09:54:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
23/01/2017 20:28:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2016
Network:
Windows Server 2016
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01646970
Message ID:
01646983
Vues:
53
>Hi All,
>
>Is there a way to programmatically re-order the columns in a table? I want to export the table to an Excel sheet in a user-defined order.
>Thanks.
>
>Luke

In a SELECT - SQL statement, you can define both the order of the records, and the order of the fields. You can also specify which fields (and which records) to include in the result. Example:
select LastName, FirstName;
  from Customer;
  where Active;
  order by LastName, FirstName;
  into cursor Temp
Then you can use that cursor to copy to an Excel file (copy to ... type xls), use Automation to copy one field at a time, etc.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform