Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I represent three-dimensions on a form? CrossTAB?
Message
 
 
À
14/09/2000 13:52:18
J Chris Powell
Myers and Stauffer Lc
Kansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00416181
Message ID:
00485961
Vues:
26
Chris,

I have used a SQL command directly like the one below, which is similar to what you use in your program. It works great for me but only for summing up whole numbers. If the field that you want summarized contains decimal places, only the sum of the values of the category to which the first record in your source table belongs shows the decimals...the rest is summed and rounded off.

sele svc, size, atr, ;
sum(iif(atr = 'CB03', amount, 0)) as b03amt, ;
sum(iif(atr = 'CB02', amount, 0)) as b02amt, ;
sum(iif(atr = 'CB01', amount, 0)) as b01amt, ;
sum(iif(atr = 'CB01', qty, 0)) as b01qty,;
sum(iif(atr = 'CB02', qty, 0)) as b02qty,;
sum(iif(atr = 'CB03', qty, 0)) as b03qty;
from junk3 into cursor cuCharges_sum ;
group by svc, size order by svc

Here's a sample source:
SVC SIZE ATR QTY AMOUNT
225 LRG CB03 5 0.86
225 LRG CB01 1 0.86
225 LRG CB01 2 0.86
225 LRG CB02 1 0.86
225 LRG CB01 1 0.86

Here's the result:
SVC SIZE ATR B03AMT B02AMT B01AMT B01QTY B02QTY B03QTY
225 LRG CB01 0.86 1 3 4 2 1.00


Do you have a work around yet?

Regards,
Evelyn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform