Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with a View.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00147107
Message ID:
00147141
Views:
31
Hi Victor and Paul ---

Ok, if the goal is to show all payments and customer when it's available and instructor when it's available:
CREATE SQL VIEW myview AS ;
   SELECT ls!payment.*,ls!instructur.* FROM payment
      LEFT JOIN ls!instructor ON ls!payment.pay_inst=ls!instructor.ins_inst ;
      LEFT JOIN ls!customer ON ls!payment.pay_acct=ls!customer.cus_acct
No need to put OUTER, that's the default....now why are you joining with customer without any fields from customer in the view?





>Yep - that's one of the little quirks about the view designer - I've had the same problem when trying to use more than two tables. The trick is not to use the view designer and create it manually and use the Create View command. The SQL statement has some things in the wrong order. It MAYBE should look like
>
>SELECT Payment.*, Instructor.*;
> FROM ls!payment LEFT OUTER JOIN ls!instructor;
> ON Payment.pay_inst = Instructor.ins_inst;
> INNER JOIN ls!customer ;
> ON Payment.pay_acct = Customer.cus_acct
>
>or something to that effect. Anyway, I am sure that something is simply out of order in the SQL statement - you may have to play around with it to get it to work.
>
>>Hi,
>>
>>I am pretty new to views and I am having a problem building a view with three tables. The three tables are Payments, Customer, and Instructor. I would like a view that lists every payment and includes Customer and Instructor information. I go into the view designer and add the payment table and then the customer file the relation I create is a left join with payment.pay_acct = customer.cus_acct. I then add the instructor table with a left join on payment.pay_inst = instructor.ins_inst. The resulting sql statement follows:
>>
>>
>>SELECT Payment.*, Instructor.*;
>> FROM  ls!payment LEFT OUTER JOIN ls!instructor;
>>    INNER JOIN ls!customer ;
>>   ON  Payment.pay_acct = Customer.cus_acct ;
>>   ON  Payment.pay_inst = Instructor.ins_inst
>>
>>
>>However when I try to save the view I get an error "SQL: Column 'Pay_Acct' is not found."
>>
>>Thanks,
>>
>>Paul
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform