Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display RECNO() from SELECT-SQL
Message
From
12/02/2000 14:53:11
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00331332
Message ID:
00331357
Views:
17
All arguments aside as to why you want RECNO(), you could do this in two stages:
SELECT *,RECNO() AS rec FROM invoice INTO CURSOR cursor_b
SELECT a.fname, a.lname, b.invoice FROM Customer a, cursor_b b WHERE a.num = b.num INTO CURSOR lcTest
>>Terry,
>>
>>This is off-the-wall and I haven't tested it, but what about this:
>>
>>SELECT RECNO('invoice') AS invrec, a.fname, a.lname, b.invoice FROM Customer a, Invoice b WHERE a.num = b.num INTO CURSOR lcTest
>>
>>Note the change to how RECNO() is being used.
>>
>>
>>>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?
>
>Hi John,
>
> I tried the SELECT as you wrote it RECNO('table'). I got the record number for one table - repeated for each record.
>
> Thanks for the thought.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform