Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple Joins in a SELECT Statement for my Report
Message
 
À
27/08/2000 19:01:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00409594
Message ID:
00410116
Vues:
18
Craig,

Thanks. That will help break it down. Your right, I was looking at it too complicated. Breaking it down makes it easier.

Elgin

>Why can't you do it in two SELECT statements. I think too often VFP developers try to solve these problems with one SELECT, when two will do as good a job or better.
>
>
>>I am trying to create a SELECT statement consisting of multiple tables. The tables are parent=Nameplat, child1=Dga, and child2=Visual. All three tables have the fields Custid and Upsino in common. When I join just the Nameplat and Dga based on Custid+Upsino, it works perfectly and very speedy. However when I try to add the Visual table I get way too many records, over 4000 versus 462 in my test query. I plan on using this SELECT statement for the record source of my report, and I want to add a third table to it. This third table is a Parent over the Nameplat called CUST. Here's the SELECT statement I'm trying to make work:
>>
>>
>>SELECT dga.upsino, dga.puldat, dga.hydrogen, ;
>>nameplat.serial_no, nameplat.manufactur, nameplat.upsino AS "upsinoname", ;
>>visual.optemp, visual.upsino AS "upsinovisual", visual.datinp ;
>> FROM nameplat INNER JOIN dga ON nameplat.custid+nameplat.upsino=dga.custid+dga.upsino ;
>> INNER JOIN visual ON dga.custid+dga.upsino=visual.custid+visual.upsino ;
>>   INTO CURSOR rdga ;
>>  WHERE dga.custid=gcCustid ;
>>ORDER BY dga.upsino ASC, dga.puldat DESC, visual.datinp DESC
>>REPORT FORM dga2 PREVIEW
>>
>>
>>What am I doing wrong here? I have been trying this one for quite a while now. Will I be able to add Cust to this SELECT statement? Any help much appreciated.
>>
>>Thanks
>>Elgin
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform