Printing the Row Position

Results 1 to 2 of 2

Thread: Printing the Row Position

  1. #1
    Join Date
    Dec 1969
    Posts
    18

    Default Printing the Row Position

    Hi there,<BR><BR>I would like to print as a result of the query, the position of that record in the result.<BR><BR>Example:<BR><BR>Select Record_Position, Name, Points from player<BR>Order by Points desc<BR><BR>Does any one have any idea?<BR><BR>Thanks <BR><BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Printing the Row Position

    I assume by record position you mean for the query returned. So, you&#039d like the following query:<BR><BR>Select Record_Position, Name, Points from player<BR>Order by Points desc<BR><BR>to return something like:<BR><BR>1 Scott 100<BR>2 Bob 39<BR>3 James 43<BR><BR>Correct? Well, just use ASP. When you iterate through your recordset, keep a counter variable.<BR><BR>Dim iCount<BR>iCount = 1<BR>Do While Not objRS.EOF<BR><BR>Response.Write iCount & " - " & objRS("Name") & "<BR>"<BR>iCount = iCount + 1<BR>objRS.MoveNext<BR><BR>Loop<BR><BR><BR>Hope this helps! :)<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
  •