Morning
Could anyone give me any code that would enable me to call the last 5 records from an sql database?
Printable View
Morning
Could anyone give me any code that would enable me to call the last 5 records from an sql database?
how big is the database?
around 200 records holding articles......
You can still use the top function because you say you want the last 5 records. Last is just relative to if the recordset is sorted ascending or descending. So do this:
Code:Select top 5 yourfieldname from yourtable where ... order by yourfieldname asc(or desc)