Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with select statement please
Message
From
17/12/2003 14:03:27
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00860009
Message ID:
00860035
Views:
19
Hi John,

----------
table1 table2 table3
------ ------ ------
A RED JOHN
B BLUE
C YELLOW
ORANGE
GREEN
----------

You cannot use RECNO() on SELECT without VFP advanced information.

Use this trace ( NOT TESTED )
CREATE CURSOR Result ( F1 C(1),F2 C(10), F3 C(10))
* table1,table2,table3 have no index active
SELECT table1
maxSet =RECCOUNT()
IF RECCOUNT('table2')>m.maxSet
   SELECT table2
   maxSet =RECCOUNT()
  SET RELATION TO RECNO() INTO table1
ELSE
  SET RELATION TO RECNO() INTO table2
ENDIF
IF RECCOUNT('table3')>m.maxSet
   SET RELATION TO RECNO() INTO (ALIAS()) IN table3
   SELECT table3
ELSE
   SET RELATION TO RECNO() INTO table3
ENDIF
SCAN
 INSERT INTO Result (table1.field,table2.field,table3.field)
ENDSCAN
* remove relations
Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform