Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT & recno()
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00168223
Message ID:
00168301
Views:
33
>>>Is there any way to have SELECT selects RECNO()? TO make it harder I have more then one table in this SELECT statement.
>>>TIA Mark
>>
>>You could try:
>>
>>Select ..., Recno("Table1") as RecNo1, Recno("Table2") as RecNo2 ...
>>
>>Something like:
>>
>>Select table1.*, recno("Table1") as RecNo1, ...
>>
>>would most likely not work. You have to explicitly list all the fields you want.
>
>Nope, putting RECNO('alias') will never work during the SELECT. Once the SELECT code kicks in, there is no guarantee that FP will use your alias internally. Edward's suggestion to do it in two passes will work.

I tried manually assigning an alias with:

select a.field1, a.recno("a") as RecNo1,... from table1 a, table2 b where ...

That only returned the correct recno() for alias B, the recno returned for alias A was always 1. Interesting. I tried doing this with deleted() as well trying to resolve another problem with parameterized views not bringing over the deleted marker if set deleted is off. :(
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform