Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ulhas Amrite
  Where is Ulhas Amrite?
 Pune
 India
 Ulhas Amrite
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: Sql command not running at first pass
Thread ID: 104266 Message ID: 104303 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Monday, August 14, 2006 8:19:25 PM         
   


> > I am running following SQL command
> >
SELECT Pomast.pono, Pomast.podate, Pomast.rate, Heading.rate,;
> >   Pomast.heading, Pomast.scode, Taxrate.tax_rt;
> >  FROM  pomast INNER JOIN heading;
> >     INNER JOIN taxrate ;
> >    ON  Pomast.scode = Taxrate.maincode ;
> >    ON  Pomast.heading = Heading.tarrifhead

> > When run for the first time it gives error as "sql column scode not found".
> > but if the same command is repeated it gives proper results.
> > What could be the cause. (the sql command was copied form the query bulider)
> > LInk below gives the tables I am using.
> >
> > Ulhas Amrite
> >
> > https://www.foxite.com/uploads/66bb6080-a593-41e9-a7bc-26b24384f238.zip

>
> Your sequence on JOIN and ON are not the same. That is why I prefer always to put ON after JOIN. Try:
>
> SELECT Pomast.pono, Pomast.podate, Pomast.rate, Heading.rate,;
>        Pomast.heading, Pomast.scode, Taxrate.tax_rt;
> FROM pomast;
> INNER JOIN heading ON  Pomast.heading = Heading.tarrifhead;
> INNER JOIN taxrate ON  Pomast.scode   = Taxrate.maincode
> 

>
> Borislav Borissov
>
>


Hi, Borislav,

Many Thanks, It works! but what I don't understand that - I have not written this query - I used the query builder and copy-pasted the query.
then why it should go wrong?

Ulhas Amrite


Ulhas Amrite

ENTIRE THREAD

Sql command not running at first pass Posted by Ulhas Amrite @ 8/14/2006 12:30:45 PM
RE: Sql command not running at first pass Posted by Ralph Toledo @ 8/14/2006 12:55:19 PM
RE: Sql command not running at first pass Posted by Borislav Borissov @ 8/14/2006 1:05:08 PM
RE: Sql command not running at first pass Posted by Ulhas Amrite @ 8/14/2006 8:19:25 PM
RE: Sql command not running at first pass Posted by Borislav Borissov @ 8/14/2006 8:29:55 PM
RE: Sql command not running at first pass Posted by Ken Murphy @ 8/16/2006 2:07:10 PM
RE: Sql command not running at first pass Posted by Borislav Borissov @ 8/16/2006 2:36:28 PM