Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: ven chin
  Where is ven chin?
 
 Singapore
 ven chin
 Tags
Subject: RE: invalid sub query
Thread ID: 228579 Message ID: 228619 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Wednesday, May 20, 2009 10:57:36 AM         
   


> >
> >
> >
> > Can't be as simple as the space missing before the semi-colon after rmbamt and d.blno in the order by?
> >
> > Have you worked it a piece at a time? Pull the first table and fields you want from it, join the next one, etc. until you figure out which one is causing the problems?
> >
> > D
>
> Yes. I tried to shorten my query, to run piece by piece, unfortunately, i m still having the same problem.
>
> SELECT d.etapol, d.origin, d.pol, d.pod, d.deliveryp FROM local_invh h INNER JOIN (SELECT portcode,desc as desc FROM portcode) as e ON d.origin = e.portcode INTO CURSOR ViewAttach

These types of subqueries were only introduced in VFP9. A quick look in the Help for VFP8 would have shown you.
Derrick is right about subqueries after FROM or JOIN need to be named
 JOIN (subquery) AS X2 ON X2.key=A.key 

But still you need VFP9. In VFP8, o it with separate queries.

-Anders

ENTIRE THREAD

invalid sub query Posted by ven chin @ 5/20/2009 3:33:14 AM
RE: invalid sub query Posted by Christian Tabligan @ 5/20/2009 4:13:28 AM
RE: invalid sub query Posted by ven chin @ 5/20/2009 7:26:09 AM
RE: invalid sub query Posted by Christian Tabligan @ 5/20/2009 8:13:11 AM
RE: invalid sub query Posted by Derrick Bruce @ 5/20/2009 6:01:59 AM
RE: invalid sub query Posted by ven chin @ 5/20/2009 6:18:25 AM
RE: invalid sub query Posted by Derrick Bruce @ 5/20/2009 6:39:58 AM
RE: invalid sub query Posted by ven chin @ 5/20/2009 7:25:26 AM
RE: invalid sub query Posted by Anders Altberg @ 5/20/2009 10:57:36 AM
RE: invalid sub query Posted by Derrick Bruce @ 5/20/2009 8:37:39 PM