Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining the last record in a DBF
Message
From
10/01/2006 09:31:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01085156
Message ID:
01085174
Views:
18
>>>>>How would I determine the last record in a DBF using SQL?
>>>>>I've seem some examples on the net but they are = sql engine specific.
>>>>
>>>>What is the defenition of the last record? Which column(s) determine the order?
>>>
>>>The last record entered into the table chronologically.
>>
>>You have to have a column in the table that holds this information. There's no such thing as chronological order in the tables on client-sever backends in general. For MS SQL server, for example, the records are ordered either by clustered index, if there's one, or not ordered at all.
>
>But this is a DBF I'm working with here. MAX(RECNO()) would be the record but I want the other fields as well.

Try.
SELECT * FROM mytable WHERE RECNO() = (SELECT(MAX(RECNO()) FROM mytable)
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform