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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display all records in rs EXCEPT first row 1

Status
Not open for further replies.

jayraykay

Programmer
Mar 10, 2004
22
US
Hello.

I have created a simple result set that displays all rows and fields in a table ordered by a timestamp field descending.

select * from tablename order by timefield desc

I need to display all the records except the first row in this set.

Can someone be of assistance?

Thank you.
 
display" is client issue. Can you simply skip first record then loop over rest, e.g.:
Code:
If not RS.Eof Then 
	RS.moveNext
	
	Do While not RS.Eof
		-- display record
		RS.moveNext
	Loop
	
End If

------
Math problems? Call 0800-[(10x)(13i)^2]-[sin(xy)/2.362x]
 
If you don't want to handle it at the client as you should:
Code:
[Blue]SELECT[/Blue] [Gray]*[/Gray] [Blue]FROM[/Blue] tablename 
   [Blue]WHERE[/Blue] ID[Gray]<[/Gray][Gray]>[/Gray][Gray]([/Gray][Blue]SELECT[/Blue] [Blue]TOP[/Blue] 1 ID [Blue]FROM[/Blue] tablename 
                 [Blue]ORDER[/Blue] [Blue]BY[/Blue] timefield [Blue]DESC[/Blue][Gray])[/Gray]
   [Blue]ORDER[/Blue] [Blue]BY[/Blue] timefield [Blue]DESC[/Blue]
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top