Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return 5 Most Recent Rows

Status
Not open for further replies.

lah3233

MIS
Jul 15, 2003
33
US
Is there anyway in a SQL query to display the most recent fields submitted based on a datetime field? If so what is the proper syntax?

Thanks!
 
select top 5 *
from table2
order by timestamp

Thanks

J. Kusch
 
Sorry ... for the last 5 you need the DESC clause too

select top 5 *
from test
order by dateme desc

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top