Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rows to column
Message
De
01/03/2015 14:45:22
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01616010
Message ID:
01616038
Vues:
32
when I changed "cast(0 as N(10))" to "cast(Null as N(10))",
it worked as I wanted

>>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?
>
>Just use big negative number instead of cast(0 as N(10)) in this case. E.g. assuming you never have something like this
>-9999999999 in a table.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform