Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Querying matching records in 2 tables
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00959135
Message ID:
00959138
Views:
8
This message has been marked as the solution to the initial question of the thread.
select planning.mainkey, planning.planextra1, planning.comments ;
	from  planning ;
		JOIN modacad ON modacad.mainkey=planning.mainkey;
	where NOT modacad.mochk002  ;
	into cursor crsresult
>
>I have 2 tables namely modacad and planning. Each table has an identifier named mainkey. There is a one to many relationship between these 2 tables meaning that there is only 1 record of that mainkey in the modacad table and in planning there could be more than 1 record with the same mainkey. I want to query where the mainkey in modacad is equal to SS2005 and a logical field mochk002=.f. . Therefore what I would expect is to list all records in modacad that mochk002 is false and the corresponding records in planning. I think I need a join but I cannot get it to work. Can anybody help me with my syntax please?
>
>
>select mainkey, planextra1, comments ;
>from  planning ;
>where modacad.mochk002=.f. and modacad.mainkey=planning.mainkey ;
>into cursor crsresult
>
>
>Any help would be much appreciated
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform