Perhaps you could add to the original query a computed field giving the position in IDList of the ID of that record. Then you could say ORDER BY the computed field.
This is conceptually the same as an earlier suggestion but might prove more efficient for large result sets? Duncan -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 29 September 2003 13:23 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] order by actually I'm now looking into using something like a Switch or IIF statement to achieve the same, in the query, but not having any success so far. The Switch was 'too complex' (the list could have a lot of ID's in it), and I couldn't figure out the IIF syntax. Duncan Cumming IT Manager http://www.alienationdesign.co.uk mailto:[EMAIL PROTECTED] Tel: 0141 575 9700 Fax: 0141 575 9600 Creative solutions in a technical world ---------------------------------------------------------------------- Get your domain names online from: http://www.alienationdomains.co.uk Reseller options available! ---------------------------------------------------------------------- ---------------------------------------------------------------------- "Paul Johnston" <[EMAIL PROTECTED] To: <[EMAIL PROTECTED]> tions.com> cc: Subject: RE: [ cf-dev ] order by 29/09/2003 11:32 Please respond to dev Prob post-process the query data... And store in an array/query! Ie... You put the list into an array, then loop over the query, find the position in the array, and then add it to a new array/query or whatever format you want! Can't guarantee the order things are going to come out in using that syntax! Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: 29 September 2003 11:21 > To: [EMAIL PROTECTED] > Subject: [ cf-dev ] order by > > > say you've got a query like: > > <cfquery> > SELECT ID, Name > FROM Table > WHERE ID IN (#IDList#) > </cfquery> > > where IDList maybe looks like 1,7,2,8,3,6,55,4, etc. How do > you get the query to order by the order specified in your > list? Using an access database, I've got a query like this, > but it seems to be ordering by ID by default, i.e. the order > the records are stored in the table. Any simple ways to not > make this happen, like ORDER BY #IDList# ? > > > Duncan Cumming > IT Manager > http://www.alienationdesign.co.uk mailto:[EMAIL PROTECTED] Tel: 0141 575 9700 Fax: 0141 575 9600 Creative solutions in a technical world ---------------------------------------------------------------------- Get your domain names online from: http://www.alienationdomains.co.uk Reseller options available! ---------------------------------------------------------------------- ---------------------------------------------------------------------- -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
