Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complicated Query
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01366648
Message ID:
01366689
Views:
13
> 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform