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!

Displaying the database query

Status
Not open for further replies.

campbemr

Technical User
Aug 16, 2001
19
US
If I search a database how can I display the results of the search in an order where the most recent item added to the database is shown first?
 
Your question is a bit broad ....how are you connecting to the database....how are you querying it? I connect to SQL databases and if I am not calling a stored procedutre it would look something like this:

set rs=server.createobject("adodb.recordset")
ssql="select * from your table where column like '%param%' order by Date_column desc"
rs.open ssql, YourConnectionString


The ssql statement is the place to set the order of your results...in this case the column is named Date_column and the desc is indicates descending order....(i always forget if dates are past to present or now backwards if this is backwards then just take off "desc")


hope this helps

bassguy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top