Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving data from 1 column to another
Message
De
09/12/1999 10:45:51
 
 
À
09/12/1999 10:34:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00300964
Message ID:
00301018
Vues:
21
It's hackneyed, but one way to do it would be:


SELECT acctg_prd,trans_amt,;
IIF(acctg_prd="0100",trans_amt,0000000.00) AS amt1,;
IIF(acctg_prd="0200",trans_amt,0000000.00) AS amt2,;
IIF(acctg_prd="0300",trans_amt,0000000.00) AS amt3,;
IIF(acctg_prd="0400",trans_amt,0000000.00) AS amt4,;
FROM mytable




>Here is the problem revised layout.
>
>acctg_prd.......trans_amt
>0100............ 45.00
>0200............. 4.00
>0300............ 23.00
>
>results are:
>acctg_prd......trans_amt.....1.....2.....3....4
>0100............45.00......45.00
>0200.............4.00................4.00
>0300............23.00......................23.00
>
>Sorry I previewed it and it looked ok
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform