> You can not do this in one query in VFP (except for using UDF), though you can do this easily in SQL Server.
Why not? What I am missing?
select vou_no, ;
Sum(Iif(party = 'A', qty, 0)) as A, ;
Sum(Iif(party = 'B', qty, 0)) as B, ;
Sum(Iif(party = 'C', qty, 0)) as C, ;
Sum(Iif(party = 'D', qty, 0)) as D, ;
Sum(rate * qty) as cr_amount ;
from Temp ;
group by 1 ;
into cursor Temp2
BROWSE LAST NORMAL nowait
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges