here is how I would do it, others may have a better suggestion:
<CFSET userGateway = Application.Reactor.createGateway("user") />
<CFSET query =userGateway.createquery()>
<CFSET order = query.getorder().setdesc("user","modifieddate")>
<CFSET userGateway.createquery().setorder(order)>
<CFSET userrQuery =userGateway.getByQuery(query)>.
then you could loop through the userquery and use the first 5 rows
hope this help,
Doug S.
On 6/27/06, Jeff Chastain <[EMAIL PROTECTED]> wrote:
I have a table with contacts in it that has a lastModified field. I am looking to get the 5 most recently modified contacts from this table. The gateway object will return all records, but how do you pass criteria to it ... i.e. sort by lastModified and give me the top 5? Is this something I need to custom write into the gateway object?Sorry if this is too obvious.Thanks-- Jeff
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
