Tony,

Probably a ton of ways to do this.  Would this get you what you want?:

(note:  the below would be for oracle, you need + instead of || for Sql
server - not sure about what db you're using)

<cfquery datasource="whatever" name="qMySuggestions">
        select sql_id,
                alphanumeric_id || description as auto_suggest_descr
        from mytable
        union
        select sql_id,
                description || alphanumeric_id as auto_suggest_descr
        from mytable
        order by augo_suggest_descr
</cfquery>

Now you should have a query with the results in the order you want them with
the original sql_id also there.  Now instead of looping through an array to
do a match, you simply do a query of query:

<cfquery name="qFindMatch" dbtype="query">
        SELECT sql_id FROM qMySuggestions
        WHERE (put your condition here to find a match)
</cfquery>

qFindMatch.sql_id is the record you want.

Dave Phillips


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327252
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to