>
>
> Then in the cfswitch statement I have something like this
>
> <cfswitch expression"#url.sort#">
>    <cfcase value="name">
>          order by table.user_name
>    <cfcase>
>    <cfcase value="date">
>          order by table.lastlogin_date
>    <cfcase>
> ..
> ..


I think this is how I would go about the new order by stuff . Instead of
switch or if statements. run the query as one of the methods in a component,
then all you need to do is pass an argumentcollection item over to handle
the Order by portion.

<cfset NewSort = component.method(qOrderField=Val(name)) />

<cffunction>
<cfargument name="qOrderField" type="string" default="*">
   <cfquery name="q">
       select *
        from
      Order By #Argument.qOrderField#
   </cfquery>
   <cfreturn q>
</cffunction>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288627
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to