Results 1 to 2 of 2


  1. #1
    89 Guest

    Default SQL - PROBLEM

    Hello,<BR>The SQL-code for showing the top 5 posts from a table is.<BR>SQL - SELECT top 5 FROM table<BR><BR>But, i want to show the top1 latest (the latest) post in one place. And the the top 2-10 in another place. How to do?

  2. #2
    s. deitz Guest

    Default RE: SQL - PROBLEM

    Order them by time in the SQL query so the latest record is first. (Order by Date Desc)<BR><BR>Then, loop through the RecordSet with a counter. When the counter = 1 display the record in one place and when the counter = 2 through 10 display the record in another place.<BR><BR>&#060;%<BR>I = 1<BR>Do While Not RS.EOF<BR> If I = 1 then<BR> &#039display latest post<BR> else<BR> &#039display other posts<BR> end if<BR><BR> I = I + 1<BR> RS.MoveNext<BR><BR>Loop<BR><BR>I think that will work...<BR> <BR> <BR><BR><BR><BR>

Posting Permissions

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