Randell B Adkins wrote:
> Create a new field called Sequence or something.
> Based on the data and the two elements you displayed
> there is no way without Hard-Coding it.

Actually, there is if your database can do a little bit of maths and 
subqueries in the ORDER BY clause. But it is a bit tricky and get's out 
of hand when the number of elements in the list get's too long because 
you need to develop a power series to sort on :)

ORDER BY ( 0
<cfloop from="1" to="#ListLen(titleIDs)#" index="i">
+ (SELECT MAX(TitleID FROM tblJobTitle))^(ListLen(titleIDs) - i) * 
Round(Abs(tblJobTitle.TitleID - i)/(Abs(tblJobTitle.TitleID - i) + 1))
</cfloop> ) DESC

I doubt this will be usefull IRL, but it should work once you sort out 
the typo's you will inevitably get. Conversion to a stored procedure 
will help as well, you will be able to get the SELECT MAX(TitleID FROM 
tblJobTitle) out of the loop.

Jochem

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to