Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Issue - help
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL Issue - help
Miscellaneous
Thread ID:
00406920
Message ID:
00406920
Views:
52
This is very odd. My query always crashes the first time through, but always succeeds thereafter. It seems that perhaps VFP is not opening the tables in the correct order.

Can anyone explain how I should restructure this query?
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 ;
	    INNER JOIN .\kbdata\knowledge!kbcats;
	    INNER JOIN .\kbdata\knowledge!kbfirms;
	    LEFT OUTER JOIN .\kbdata\knowledge!kbusers;
	    LEFT OUTER JOIN .\kbdata\knowledge!kbusers kbAnsU ;
	    ON Answers.UserKey = KBAnsU.UserKey ;
	   ON  Questions.userkey = kbusers.userkey ;
	   ON  Questions.firmkey = Kbfirms.firmkey ;
	   ON  Questions.catkey = Kbcats.catkey ;
	   ON  Answers.qkey = Questions.qkey ;
	   WHERE Questions.firmkey = lcFirmKey ;
	   ORDER BY CatName, Questions.qkey, QDate ;
		INTO CURSOR TQuery
BROWSE
TIA
Kogo Michael Hogan

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

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform