swuit
asked on
Retrieve last record
I have an SQL database with thousands of records in it. The "formnumber" field is set as the key. I am writing a VB.NET application and one of the fields will require me to pull the last record in the database. I don't want to read in all the records and then sort them. Is there a way to sort the data and then read in the last record?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then use Top 1 to get the first record.
So effectively, you are getting the last record.
hongjun