Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Query Joins
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00355406
Message ID:
00355408
Views:
25
Chris,
The view designer (and I'm assuming the Query designer since they are almost identical) has trouble handling 3 tables linked together. Write your query with two tables, then copy the SQL code and put it into a PRG, adding the third table. You can get the complete wording, which for a view contains commands setting all of the view properties, by running GenDBC or GenDBCX.

HTH
Barbara

>Hi All,
>
>I have a problem with the Query Designer. I have simplified the query for this question. Basically I am selecting every entry from a ledger file and then picking up descriptions for the transaction code and payment method from their master files. The correct number of records are being generated. The following code is generated by the designer but has 2 problems.
>
>1. The query runs ok from within the designer but the field tcshorttxt contains the same data for every record. ie it doesn't match what transcode points to.
>
>2. When closing and saving the query, I get the error message SQL: Column "TRANSCODE" is not found
>
>If I reverse the Joins then the missing SQL column becomes "PAYMETHOD"
>
>If I change the second join to a Where then everything works fine but I don't think we should be doing it this way! Any ideas?
>
>PRE
>
>SELECT Rteledgr.tsurname, Rteledgr.tinitials, Rteledgr.ttitle,;
> Rteledgr.transcode, Rteledgr.paymethod, Paymeths.pmshorttxt,;
> Trancode.tcshorttxt;
> FROM rating!rteledgr INNER JOIN rating!paymeths;
> INNER JOIN rating!trancode ;
> ON Rteledgr.transcode = Trancode.transcode ;
> ON Rteledgr.paymethod = Paymeths.paymethod
>
>/PRE
>
>TIA
>Chris
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform