To show latest 10 Records

Results 1 to 2 of 2

Thread: To show latest 10 Records

  1. #1
    Join Date
    Dec 1969

    Default To show latest 10 Records

    what would be the ASP code for displaying the latest 10 records from Access Databse.<BR>Also what would be the ASP Code to search for Records for a specified period. i.e. startdate and EndDate.<BR><BR>Note:- I have referred to the information available from one of the messageboard Q & A but seems it doesn&#039;t work properly. when i key in the specific start and End Date it display&#039;s the records which doesn&#039;t match the specified period. Pls. suggest.

  2. #2
    Join Date
    Dec 1969

    Default The ASP code is exactly...

    ...the same for all queries you run on a database. It&#039;s the SQL that&#039;s different.<BR><BR>Your first question, to list the ten latest records:<BR><BR>SELECT TOP 10 Field1, Field2, Field3 FROM TheTable ORDER BY TheDate DESC;<BR><BR>To list records between certain dates, in this example everything in March, i.e. everything between 1 March 2005 and 31 March 2005 inclusive:<BR><BR>SELECT Field1, Field3, Field3 FROM TheTable WHERE TheDate &#062;= #2005/03/01# AND TheDate &#060;= #2005/03/31#;<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts