Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Issue - help
Message
 
To
18/08/2000 18:06:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00406920
Message ID:
00406926
Views:
17
Much thanks - that works great. I thought I'd be saving time by pasting the SQL from the VFP View Wizard. Serves me right..... it just confused me.

>Don't nest the JOIN..ON clauses, just go straight down how you'd like them to join. See if that helps. e.g., (note that I put the Answers table joins next to each other)
>lcFirmKey = "00000000"
>SELECT Questions.qkey, Answers.akey, Answers.adate, Answers.answer,;
>	Answers.seealso, Questions.firmkey, Questions.catkey, Questions.qdate,;
>	Questions.question, Kbcats.catname, Kbusers.username AS Q_By_Name, ;
>	Kbusers.userkey AS Q_By_Key, KBAnsU.UserName AS A_By, ;
>	KBAnsU.userkey AS A_By_Key;
>	FROM  .\kbdata\knowledge!answers ;
>	RIGHT OUTER JOIN .\kbdata\knowledge!questions ;
>	ON  Answers.qkey = Questions.qkey ;
>	LEFT OUTER JOIN .\kbdata\knowledge!kbusers kbAnsU ;
>	ON Answers.UserKey = KBAnsU.UserKey ;
>	INNER JOIN .\kbdata\knowledge!kbcats;
>	ON  Questions.catkey = Kbcats.catkey ;
>	INNER JOIN .\kbdata\knowledge!kbfirms;
>	ON  Questions.firmkey = Kbfirms.firmkey ;
>	LEFT OUTER JOIN .\kbdata\knowledge!kbusers;
>	ON  Questions.userkey = kbusers.userkey ;
>	WHERE Questions.firmkey = lcFirmKey ;
>	ORDER BY CatName, Questions.qkey, QDate ;
>	INTO CURSOR TQuery
>
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform