> Specify a maxrows attribute in your CFQUERY call and sort by date
> descending:
>
> <cfquery name="myName" datasource="myDSN" maxrows=5 dbtype="ODBC">
>   SELECT ....
>   FROM ..
>   WHERE ..
>   ORDER BY submittedDateTime DESC
> </cfquery>

Just one word to say to this - YUK!

MaxRows trims the output after SQL has done the work - if the table has
hundreds of thousands of records, this will still take time to come from the
database - it's a LOT quicker to get SQL to trim out 5 records, than to get
CF to trim them out.

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to