PDA

Click to See Complete Forum and Search --> : Grabbing the most recent record


Stephen Warker
Jun 15th, 2000, 02:14 AM
I am having a problem with an asp page. I have a link that when you click it, it goes in my database and show the most recent record. Obviously there is date field, but i am not sure how you grab this record. Can anyone give me the correct sql code to achieve this result. I am ok on everything except the sql. I even have the database sorted by descending order by the date, so the most recent is on the top.


thanks
Stephen

Clunietp
Jun 15th, 2000, 10:09 AM
you have a couple choices:

SQL like this:
select * from orders where orderdate in (select max(orderdate) from orders)

Or just open your recordset, sorted by date descending, and just display the first record