Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display RECNO() from SELECT-SQL
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00331332
Message ID:
00331525
Views:
17
You cannot reliably get the RECNO() in a SQL SELECT. This is documented in Help. This is one of the reasons you should have a Primary Key on every record.


>Hello,
>
> I want to display the record number of my customer table from SELECT-SQL. I am able to do this when I use only the customer table, but if I join another table, I am unable to display the record number from the customer table.
>
> If I issue: "SELECT RECNO(), fname, lname FROM Customer INTO CURSOR lcTest," I get Customer.dbf's record number for each record.
>
> If I now join a second table into the SELECT-SQL, i.e., If I issue: "SELECT RECNO(), a.fname, a.lname, b.invoice FROM Customer a, Invoice b WHERE a.num = b.num INTO CURSOR lcTest," I get a record number, but it is not the record number from the Customer table, which is what I want.
>
> Does anyone know how I can get the record number from the first table?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform