Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00601655
Message ID:
00601677
Vues:
14
If I understand what you're asking, would a UNION cover it?
SELECT 1 AS ColumnOrdering, ItemOrdering, ColumnnA AS C1, ColumnB AS C2, ColumnC AS C3;
   FROM myTable ;
UNION
   SELECT 2 AS ColumnOrdering, ItemOrdering, ColumnnD AS C1, ColumnE AS C2, ColumnF AS C3;
   FROM myTable ;
INTO myExportTable ;
ORDER BY 1, 2
SQL may not necessarily respect the physical ordering of the table (and good SQL code doesn't rely on this). So, a possible issue with this is that you'll need some kind of item ordering field (perhaps this actually is one of the columns).

Also note that the columns must be UNION-compatible -- same data type and size. If they aren't you can use appropriate functions to pad or whatever to the required field size.

Jay


>I have several Tables with data that I copy over to an excel spreadsheet. I never have to worry about the number of records exceeding the alloted number of rows. The spreadsheet ends up having cloumns "A" through "AI." I would rather have the colums appear under each other. I other words:
>
>ColumnA columnB columnC columD columnE columnF in table
>
>in spreadsheet
>
>ColumnA columnB columnC
>columD columnE columnF
>
>all fo the colums have different headers or names. Is this possible in VFP?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform