Al, You need to have a join in the select statement which reflects the 
relationship as SQL meremy opens a copy of the table to do the extract so as 
far as it is concerned the two tables won't be related.

Dave


-----Original Message-----
From: profox-boun...@leafe.com [mailto:profox-boun...@leafe.com] On Behalf Of 
Allen
Sent: 13 March 2012 17:00
To: profox@leafe.com
Subject: relations VFP9 SP2

Hi foxgang.
I'm trying something I have not been doing for some time. No rude comments 
please.
I have two tables. Both of which are used twice. For now just think of one 
table used twice. There are two counters in the table and the second points to 
the first so for example, record 1 may point to record 150. So I have a 
relation set and if I move the pointer in the first table, the relative record 
will be shown in the second. ok that's fine. But now I want to select fields 
from each table.
Select distinct ;
table1.field1 as f1,;
table1.field2 as f2,;
table2.field3 as f3,;
table2.field4 as f4;
into cursor mycursor.

Despite the relation set I seem to get the records from table1 ok, but the 
records from table2 are only the first record. So while f1 and f2 are filled 
correctly, f3 and f4 are record 1 all the time. And not the related record. 
Can what I want to do be done. Im sure IO did this in VFP3 (shows how long ago 
it was) but it fails in VFP9 SP2.

Any clues please

Al 


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/bd031ecabf2b60499200aab3dbb4a999921f7...@ex-a-fpl.fpl.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to