Dan, thanks for posting. Presumably you need to do another query initially to 
determine how many pages potentially to display dependent on the recordcount? 
(ie if there were 1000 records (recordcount?) and you elected to display 10 
records/page that would be 100 pages).

Andrew.

>You can do it with w/pure SQL server, but it can be pretty expensive
>depending on the query.
>
>The idea is to do:
>
>select top 10
>       *
>from
>       (
>               select top 40
>                       *
>               from
>                       table
>               order by
>                       tableId asc
>       )
>order by
>       tableId desc
>
>You have to match up the where clauses exactly. The idea is the virtual
>table grabs the current page number and add one then multiply by the number
>of records to display (records*(page+1) = 10*(3+1).) This would pull out the
>top 40 records. You then order by descending grabbing out just the number of
>items on the page. This will grab out records 31-40.
>
>Hope this helps!
>
>-Dan
>
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236376
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to