.... and there is even a better solution if ID is unique in the table: <cfset startRow = 51> <cfset lastRows= 100>
<cfquery name="ids"> SELECT ID FROM myTable WHERE a < 5 and b LIKE '%test%' ORDER BY ID </cfquery> <CFSET firstId = ids.ID[startRow]> <CFSET lastId = ids.ID[ids.lastRow]> <cfquery name="all"> SELECT * FROM myTable WHERE ID >= firstRow AND ID <= lastRow </cfquery> -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216949 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

