Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Alan Tuscano
  Where is Alan Tuscano?
 Manila
 Philippines
 Alan Tuscano
 Tags
Subject: RE: SubQuery in VFP 6
Thread ID: 268557 Message ID: 268559 # Views: 45 # Ratings: 1
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Tuesday, July 13, 2010 8:57:53 AM         
   


> Hi,
>
> Error in Subquery. Invalid use of SubQuery
>
>   Select ; 
>            a1.Datasrce			As Datasrce, ;
> 	   a1.Network			As iNetwork, ;
> 	   a1.Source			As Source, ;
> 	   b1.Code	 		As BankName, ;
> 	   a1.Issuer 			As BankCode, ;
> 	   a1.Service			As Service, ;	   	       
> 	   Space(10)			As MDR, ;
> 	   Sum(a1.Count)		As Count, ;
> 	   Sum(a1.issFee)		As AmtFee, ;
> 	   Sum(a1.AcqFee)		As Net, ;
> 	   a1.SwitchFee			As MLFee, ;	       
> 	   (select Fee from MchProf where mchprof.service = a1.service)as ml_fee ;
> 	   From &DBF_TXN a1 Full Join Bank b1 ;
> 	   On a1.Acquirer = b1.Id ;
> 	   Where a1.source = 3 ;	       
> 	   And b1.Id = cBank ;	       	       
> 	   And (a1.Network = 531111 or a1.Network = 64) ;	
> 	   Group by a1.Network, a1.Issuer, a1.Service ;
> 	   Order by a1.NetWork Desc, a1.Issuer ;	       	       
> 	   Into Table curIssuerBn
> 

>
> Where is my mistake?
>
> Alan
> Ad Majorem Dei Gloriam.

VFP6 does not support subquery. You could install VFP9 OLE DB driver and try the same query thru that with SQLSTRINGCONNECT and SQLEXEC.

use (DBF_TXN) instead of &DBF_TXN


Regards
Tushar

ENTIRE THREAD

SubQuery in VFP 6 Posted by Alan Tuscano @ 7/13/2010 8:47:17 AM
RE: SubQuery in VFP 6 Posted by tushar @ 7/13/2010 8:57:53 AM
RE: SubQuery in VFP 6 Posted by Alan Tuscano @ 7/13/2010 11:57:55 AM
RE: SubQuery in VFP 6 Posted by Tamar Granor @ 7/13/2010 11:07:31 PM