Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rows to column
Message
From
01/03/2015 14:24:52
 
 
To
01/03/2015 09:07:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01616010
Message ID:
01616033
Views:
42
Thank you but...
I found this on the net:
Table(A) can be transposed to table(B)

(A)
Number time amount
1 1 63,52
1 2 87,52
1 3 42,56
2 1 7,8
2 2 6,07
2 3 98,5

(B)
1 2 3
63,52 87,52 42,56
7,8 6,07 98,5

by using this sql select:
select max(iif(Time = 1, Amount,cast(0 as N(10)) as [a1],;
max(iif(Time = 2, Amount,cast(0 as N(10)) as [a2],;
max(iif(Time = 3, Amount,cast(0 as N(10)) as [a3];
from myTable;
GROUP BY Number
It would be perfect but when I tried and it worked unfortunately only with positive numbers.
When "Amount" is a negative number, it results 0.
Any help?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform