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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only