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

Maxrows twist

Status
Not open for further replies.

chandler

MIS
Dec 10, 2000
66
US
I would like to grab the bottom 50 records of a table and display them in ascending order by IDnum and not descending order. So far, I can query for the bottom 50 by using a query and maxrows sort descending. But I don't know how to then display the records ascending in my output. I'm sure it's one of things that's right in front of my face while I'm looking through binoculars! Thanks! Chandler
I ran over my dogma with karma!
 
Hi Chandler.

Have you got CF5? If so you can do a query on a query. eg.

<CFQUERY name=&quot;qryBottom&quot; datasource=&quot;#DatasourceName#&quot;>
SELECT TOP 50 * FROM Table
ORDER BY IDNum DESC
</CFQUERY>

then re-order this by querying the query
<CFQUERY name=&quot;qryReOrder&quot; datasource=&quot;qryBottom&quot; dbtype=&quot;query&quot;>
SELECT * FROM qryBottom
ORDER BY IDNum ASC
</CFQUERY>

then display the second query
<CFOUTPUT query=&quot;qryReOrder&quot; ...

Hope this helps,
Jackie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top