Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving data from 1 column to another
Message
From
09/12/1999 10:45:51
 
 
To
09/12/1999 10:34:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00300964
Message ID:
00301018
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform