Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Joins in a SELECT Statement for my Report
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Multiple Joins in a SELECT Statement for my Report
Miscellaneous
Thread ID:
00409594
Message ID:
00409594
Views:
42
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
Next
Reply
Map
View

Click here to load this message in the networking platform